File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { TermQuery } from '../../src/lib/term-query' ;
22import { AxiosInstance , httpClient } from '@contentstack/core' ;
33import MockAdapter from 'axios-mock-adapter' ;
4- import { TermQueryFindResponseDataMock } from '../utils/mocks' ;
4+ import { termQueryFindResponseDataMock } from '../utils/mocks' ;
55import { MOCK_CLIENT_OPTIONS } from '../utils/constant' ;
66
77describe ( 'TermQuery class' , ( ) => {
@@ -19,8 +19,8 @@ describe('TermQuery class', () => {
1919 } ) ;
2020
2121 it ( 'should return response data when successful' , async ( ) => {
22- mockClient . onGet ( '/taxonomy-manager/taxonomy_testing/terms' ) . reply ( 200 , TermQueryFindResponseDataMock ) ;
22+ mockClient . onGet ( '/taxonomy-manager/taxonomy_testing/terms' ) . reply ( 200 , termQueryFindResponseDataMock ) ;
2323 const response = await termQuery . find ( ) ;
24- expect ( response ) . toEqual ( TermQueryFindResponseDataMock ) ;
24+ expect ( response ) . toEqual ( termQueryFindResponseDataMock ) ;
2525 } ) ;
2626} ) ;
Original file line number Diff line number Diff line change 11import { AxiosInstance , httpClient } from '@contentstack/core' ;
22import MockAdapter from 'axios-mock-adapter' ;
3- import { TermQueryFindResponseDataMock } from '../utils/mocks' ;
3+ import { termQueryFindResponseDataMock } from '../utils/mocks' ;
44import { MOCK_CLIENT_OPTIONS } from '../utils/constant' ;
55import { Term } from '../../src/lib/term' ;
66import { Taxonomy } from '../../src/lib/taxonomy' ;
@@ -20,9 +20,9 @@ describe('Term class', () => {
2020 } ) ;
2121
2222 it ( 'should fetch the term by uid response when fetch method is called' , async ( ) => {
23- mockClient . onGet ( '/taxonomy-manager/taxonomy_testing/terms/term1' ) . reply ( 200 , TermQueryFindResponseDataMock . terms [ 0 ] ) ; //TODO: change to /taxonomies
23+ mockClient . onGet ( '/taxonomy-manager/taxonomy_testing/terms/term1' ) . reply ( 200 , termQueryFindResponseDataMock . terms [ 0 ] ) ; //TODO: change to /taxonomies
2424
2525 const response = await term . fetch ( ) ;
26- expect ( response ) . toEqual ( TermQueryFindResponseDataMock . terms [ 0 ] ) ;
26+ expect ( response ) . toEqual ( termQueryFindResponseDataMock . terms [ 0 ] ) ;
2727 } ) ;
2828} ) ;
Original file line number Diff line number Diff line change @@ -1698,7 +1698,7 @@ const taxonomyFindResponseDataMock = {
16981698 }
16991699 ]
17001700}
1701- const TermQueryFindResponseDataMock = {
1701+ const termQueryFindResponseDataMock = {
17021702 "terms" : [
17031703 {
17041704 "taxonomy_uid" : "taxonomy_testing" ,
@@ -1742,5 +1742,5 @@ export {
17421742 gfieldFetchDataMock ,
17431743 gfieldQueryFindResponseDataMock ,
17441744 taxonomyFindResponseDataMock ,
1745- TermQueryFindResponseDataMock ,
1745+ termQueryFindResponseDataMock ,
17461746} ;
You can’t perform that action at this time.
0 commit comments