Skip to content

Commit

Permalink
test(clerk-js): Test cases for trimLeadingSlash
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Oct 18, 2023
1 parent 7ec9146 commit a591162
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/clerk-js/src/utils/__tests__/url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
isValidUrl,
mergeFragmentIntoUrl,
requiresUserInput,
trimLeadingSlash,
trimTrailingSlash,
} from '../url';

Expand Down Expand Up @@ -239,6 +240,15 @@ describe('trimTrailingSlash(string)', () => {
});
});

describe('trimLeadingSlash(string)', () => {
it('trims all the leading slashes', () => {
expect(trimLeadingSlash('')).toBe('');
expect(trimLeadingSlash('/foo')).toBe('foo');
expect(trimLeadingSlash('/foo/')).toBe('foo/');
expect(trimLeadingSlash('//foo//bar///')).toBe('foo//bar///');
});
});

describe('appendQueryParams(base,url)', () => {
it('returns the same url if no params provided', () => {
const base = new URL('https://dashboard.clerk.com');
Expand Down

0 comments on commit a591162

Please sign in to comment.