Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing v7 expectations in browser spec #751

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions examples/browser-rollup/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions examples/browser-webpack/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions test/browser/browser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

const v1Regex = /^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i;
const v4Regex = /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i;
const v7Regex = /^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i;

const v1 = (result) => expect(result).toMatch(v1Regex);
const v4 = (result) => expect(result).toMatch(v4Regex);
const v7 = (result) => expect(result).toMatch(v7Regex);
const v3dns = (result) => expect(result).toBe('9125a8dc-52ee-365b-a5aa-81b0b3681cf6');
const v3url = (result) => expect(result).toBe('c6235813-3ba4-3801-ae84-e0a6ebb7d138');
const v3custom = (result) => expect(result).toBe('f5a52d34-dcd7-30f7-b581-0112fab43d0c');
Expand All @@ -22,6 +24,7 @@ const version = (result) => expect(result).toBe('4');
const expectations = {
'uuidv1()': v1,
'uuidv4()': v4,
'uuidv7()': v7,
'uuidv3() DNS': v3dns,
'uuidv3() URL': v3url,
'uuidv3() MY_NAMESPACE': v3custom,
Expand All @@ -37,6 +40,7 @@ const expectations = {

'uuid.v1()': v1,
'uuid.v4()': v4,
'uuid.v7()': v7,
'uuid.v3() DNS': v3dns,
'uuid.v3() URL': v3url,
'uuid.v3() MY_NAMESPACE': v3custom,
Expand Down Expand Up @@ -75,6 +79,8 @@ describe('BrowserStack Local Testing', () => {
const resultEl = await element.$('dd');
const result = await resultEl.getText();

if (!expectations[title]) throw new Error(`Unexpected title: ${title}`);

expectations[title](result);
titles.push(title);
}
Expand Down
Loading