Skip to content

Commit

Permalink
test: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Nov 22, 2023
1 parent 1ac94e8 commit c055d56
Show file tree
Hide file tree
Showing 4 changed files with 272 additions and 116 deletions.
6 changes: 3 additions & 3 deletions src/taxonomy/import-tags/data/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ describe('import taxonomy api calls', () => {
axiosMock.onPost(getTaxonomyImportNewApiUrl()).reply(201, taxonomyImportMock);
const result = await importNewTaxonomy('Taxonomy name', 'Taxonomy description');

expect(axiosMock.history.post[0].url).toEqual(getTaxonomyImportApiUrl());
expect(axiosMock.history.post[0].url).toEqual(getTaxonomyImportNewApiUrl());
expect(result).toEqual(taxonomyImportMock);
});

it('should call import tags', async () => {
axiosMock.onPost(getTagsImportApiUrl(1)).reply(200, tagImportMock);
axiosMock.onPut(getTagsImportApiUrl(1)).reply(200, tagImportMock);
const result = await importTags(1);

expect(axiosMock.history.post[0].url).toEqual(getTagsImportApiUrl(1));
expect(axiosMock.history.put[0].url).toEqual(getTagsImportApiUrl(1));
expect(result).toEqual(tagImportMock);
});
});
Loading

0 comments on commit c055d56

Please sign in to comment.