11import { Series } from '@datadog/datadog-api-client/dist/packages/datadog-api-client-v1/models/Series'
2- import { expandSeriesByLabels } from '../../src/pullRequest/expand'
2+ import { expandSeriesByValues } from '../../src/pullRequest/expand'
33
44test ( 'empty' , ( ) => {
5- expect ( expandSeriesByLabels ( [ ] , [ ] ) ) . toStrictEqual ( [ ] )
5+ expect ( expandSeriesByValues ( [ ] , 'label' , [ ] ) ) . toStrictEqual ( [ ] )
66} )
77
88test ( 'expand series by no label' , ( ) => {
@@ -16,7 +16,7 @@ test('expand series by no label', () => {
1616 points : [ [ 1579721588 , 2 ] ] ,
1717 } ,
1818 ]
19- expect ( expandSeriesByLabels ( series , [ ] ) ) . toStrictEqual ( series )
19+ expect ( expandSeriesByValues ( series , 'label' , [ ] ) ) . toStrictEqual ( series )
2020} )
2121
2222test ( 'expand series by 1 label' , ( ) => {
@@ -30,7 +30,7 @@ test('expand series by 1 label', () => {
3030 points : [ [ 1579721588 , 2 ] ] ,
3131 } ,
3232 ]
33- expect ( expandSeriesByLabels ( series , [ { name : 'app' } ] ) ) . toStrictEqual ( [
33+ expect ( expandSeriesByValues ( series , 'label' , [ 'app' ] ) ) . toStrictEqual ( [
3434 {
3535 metric : 'github.actions.pull_request_closed.total' ,
3636 points : [ [ 1579721588 , 1 ] ] ,
@@ -55,7 +55,7 @@ test('expand series by 2 labels', () => {
5555 points : [ [ 1579721588 , 2 ] ] ,
5656 } ,
5757 ]
58- expect ( expandSeriesByLabels ( series , [ { name : 'app' } , { name : 'critical' } ] ) ) . toStrictEqual ( [
58+ expect ( expandSeriesByValues ( series , 'label' , [ 'app' , 'critical' ] ) ) . toStrictEqual ( [
5959 {
6060 metric : 'github.actions.pull_request_closed.total' ,
6161 points : [ [ 1579721588 , 1 ] ] ,
0 commit comments