Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jun 28, 2023
1 parent 5c0b756 commit 286b1f2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/src/modules/utils/getProductInfoFromUrl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,28 @@ describe('getProductInfoFromUrl', () => {
});
});

it('should return x', () => {
expect(getProductInfoFromUrl('/x/introduction/')).to.deep.equal({
productCategoryId: 'x',
productId: 'null',
});
});

it('should return uncategorized', () => {
expect(getProductInfoFromUrl('/')).to.deep.equal({
productCategoryId: 'null',
productId: 'null',
});
expect(getProductInfoFromUrl('/#foo')).to.deep.equal({
productCategoryId: 'null',
productId: 'null',
});
expect(getProductInfoFromUrl('/versions')).to.deep.equal({
productCategoryId: 'null',
productId: 'null',
});
});

it('should handle MUI Toolpad', () => {
expect(getProductInfoFromUrl('/toolpad/getting-started/first-app/')).to.deep.equal({
productCategoryId: 'null',
Expand Down

0 comments on commit 286b1f2

Please sign in to comment.