Skip to content

Commit

Permalink
Update uniqueid-to-v5 (#520)
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Walton <[email protected]>
  • Loading branch information
tunetheweb and philipwalton authored Sep 26, 2024
1 parent 8760159 commit be41ea5
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion src/lib/generateUniqueID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
* @return {string}
*/
export const generateUniqueID = () => {
return `v4-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;
return `v5-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;
};
52 changes: 26 additions & 26 deletions test/e2e/onCLS-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('onCLS()', async function () {

const [cls] = await getBeacons();
assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand All @@ -75,7 +75,7 @@ describe('onCLS()', async function () {

const [cls] = await getBeacons();
assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand All @@ -96,7 +96,7 @@ describe('onCLS()', async function () {

const [cls] = await getBeacons();
assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand All @@ -121,7 +121,7 @@ describe('onCLS()', async function () {

const [cls] = await getBeacons();
assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand All @@ -144,7 +144,7 @@ describe('onCLS()', async function () {
const [cls1] = await getBeacons();

assert(cls1.value > 0);
assert(cls1.id.match(/^v4-\d+-\d+$/));
assert(cls1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls1.name, 'CLS');
assert.strictEqual(cls1.value, cls1.delta);
assert.strictEqual(cls1.rating, 'good');
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('onCLS()', async function () {
assert.strictEqual(cls2.rating, 'poor');
assert.strictEqual(cls2.entries.length, 2);
assert.match(cls2.navigationType, /navigate|reload/);
assert.match(cls2.id, /^v4-\d+-\d+$/);
assert.match(cls2.id, /^v5-\d+-\d+$/);

await browser.pause(1000);
await stubVisibilityChange('visible');
Expand Down Expand Up @@ -210,7 +210,7 @@ describe('onCLS()', async function () {
assert.strictEqual(cls3.rating, 'poor');
assert.strictEqual(cls3.entries.length, 4);
assert.match(cls3.navigationType, /navigate|reload/);
assert.match(cls3.id, /^v4-\d+-\d+$/);
assert.match(cls3.id, /^v5-\d+-\d+$/);

await browser.pause(1000);
await stubVisibilityChange('visible');
Expand Down Expand Up @@ -264,7 +264,7 @@ describe('onCLS()', async function () {
const [cls1, cls2, cls3] = await getBeacons();

assert.strictEqual(cls1.value, 0);
assert(cls1.id.match(/^v4-\d+-\d+$/));
assert(cls1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls1.name, 'CLS');
assert.strictEqual(cls1.value, cls1.delta);
assert.strictEqual(cls1.rating, 'good');
Expand Down Expand Up @@ -308,7 +308,7 @@ describe('onCLS()', async function () {
const [cls1, cls2, cls3] = await getBeacons();

assert.strictEqual(cls1.value, 0);
assert(cls1.id.match(/^v4-\d+-\d+$/));
assert(cls1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls1.name, 'CLS');
assert.strictEqual(cls1.value, cls1.delta);
assert.strictEqual(cls1.rating, 'good');
Expand Down Expand Up @@ -357,7 +357,7 @@ describe('onCLS()', async function () {

assert(cls1.value > 0);
assert(cls1.delta > 0);
assert(cls1.id.match(/^v4-\d+-\d+$/));
assert(cls1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls1.name, 'CLS');
assert.strictEqual(cls1.value, cls1.delta);
assert.strictEqual(cls1.rating, 'good');
Expand Down Expand Up @@ -395,7 +395,7 @@ describe('onCLS()', async function () {
const [cls1, cls2, cls3] = await getBeacons();

assert.strictEqual(cls1.value, 0);
assert(cls1.id.match(/^v4-\d+-\d+$/));
assert(cls1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls1.name, 'CLS');
assert.strictEqual(cls1.value, cls1.delta);
assert.strictEqual(cls1.rating, 'good');
Expand Down Expand Up @@ -454,7 +454,7 @@ describe('onCLS()', async function () {
const [cls1] = await getBeacons();

assert(cls1.value > 0);
assert(cls1.id.match(/^v4-\d+-\d+$/));
assert(cls1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls1.delta, cls1.value);
assert.strictEqual(cls1.name, 'CLS');
assert.strictEqual(cls1.value, cls1.delta);
Expand All @@ -471,7 +471,7 @@ describe('onCLS()', async function () {
const [cls2] = await getBeacons();

assert(cls2.value > 0);
assert(cls2.id.match(/^v4-\d+-\d+$/));
assert(cls2.id.match(/^v5-\d+-\d+$/));
assert(cls2.id !== cls1.id);

assert.strictEqual(cls2.name, 'CLS');
Expand All @@ -489,7 +489,7 @@ describe('onCLS()', async function () {
const [cls3] = await getBeacons();

assert(cls3.value > 0);
assert(cls3.id.match(/^v4-\d+-\d+$/));
assert(cls3.id.match(/^v5-\d+-\d+$/));
assert(cls3.id !== cls2.id);

assert.strictEqual(cls3.name, 'CLS');
Expand All @@ -508,7 +508,7 @@ describe('onCLS()', async function () {
const [cls1, cls2, cls3] = await getBeacons();

assert.strictEqual(cls1.value, 0);
assert(cls1.id.match(/^v4-\d+-\d+$/));
assert(cls1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls1.name, 'CLS');
assert.strictEqual(cls1.value, cls1.delta);
assert.strictEqual(cls1.rating, 'good');
Expand Down Expand Up @@ -543,7 +543,7 @@ describe('onCLS()', async function () {
const [cls4, cls5] = await getBeacons();

assert.strictEqual(cls4.value, 0);
assert(cls4.id.match(/^v4-\d+-\d+$/));
assert(cls4.id.match(/^v5-\d+-\d+$/));
assert(cls4.id !== cls3.id);
assert.strictEqual(cls4.name, 'CLS');
assert.strictEqual(cls4.value, cls4.delta);
Expand All @@ -570,7 +570,7 @@ describe('onCLS()', async function () {
await stubVisibilityChange('hidden');

const [cls] = await getBeacons();
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, 0);
assert.strictEqual(cls.delta, 0);
Expand All @@ -593,7 +593,7 @@ describe('onCLS()', async function () {
await beaconCountIs(1);

const [cls] = await getBeacons();
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, 0);
assert.strictEqual(cls.delta, 0);
Expand All @@ -613,7 +613,7 @@ describe('onCLS()', async function () {
await beaconCountIs(1);

const [cls] = await getBeacons();
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, 0);
assert.strictEqual(cls.delta, 0);
Expand All @@ -637,7 +637,7 @@ describe('onCLS()', async function () {
await beaconCountIs(1);

const [cls] = await getBeacons();
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, 0);
assert.strictEqual(cls.delta, 0);
Expand Down Expand Up @@ -676,7 +676,7 @@ describe('onCLS()', async function () {
const [cls] = await getBeacons();

assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.delta, cls.value);
assert.strictEqual(cls.rating, 'good');
Expand All @@ -697,7 +697,7 @@ describe('onCLS()', async function () {
const [cls] = await getBeacons();

assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand All @@ -718,7 +718,7 @@ describe('onCLS()', async function () {
const [cls] = await getBeacons();

assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand All @@ -740,7 +740,7 @@ describe('onCLS()', async function () {

const [cls] = await getBeacons();
assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand Down Expand Up @@ -786,7 +786,7 @@ describe('onCLS()', async function () {
const [cls] = await getBeacons();

assert(cls.value > 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand Down Expand Up @@ -826,7 +826,7 @@ describe('onCLS()', async function () {
const [cls] = await getBeacons();

assert.strictEqual(cls.value, 0);
assert(cls.id.match(/^v4-\d+-\d+$/));
assert(cls.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(cls.name, 'CLS');
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
Expand Down
26 changes: 13 additions & 13 deletions test/e2e/onFCP-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('onFCP()', async function () {

const [fcp] = await getBeacons();
assert(fcp.value >= 0);
assert(fcp.id.match(/^v4-\d+-\d+$/));
assert(fcp.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp.name, 'FCP');
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'good');
Expand All @@ -61,7 +61,7 @@ describe('onFCP()', async function () {

const [fcp] = await getBeacons();
assert(fcp.value >= 0);
assert(fcp.id.match(/^v4-\d+-\d+$/));
assert(fcp.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp.name, 'FCP');
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'good');
Expand All @@ -83,7 +83,7 @@ describe('onFCP()', async function () {
});

assert(fcp.value >= 0);
assert(fcp.id.match(/^v4-\d+-\d+$/));
assert(fcp.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp.name, 'FCP');
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'good');
Expand Down Expand Up @@ -153,7 +153,7 @@ describe('onFCP()', async function () {

const [fcp] = await getBeacons();
assert(fcp.value >= 0);
assert(fcp.id.match(/^v4-\d+-\d+$/));
assert(fcp.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp.name, 'FCP');
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'needs-improvement');
Expand All @@ -170,7 +170,7 @@ describe('onFCP()', async function () {

const [fcp1] = await getBeacons();
assert(fcp1.value >= 0);
assert(fcp1.id.match(/^v4-\d+-\d+$/));
assert(fcp1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp1.name, 'FCP');
assert.strictEqual(fcp1.value, fcp1.delta);
assert.strictEqual(fcp1.rating, 'good');
Expand All @@ -184,7 +184,7 @@ describe('onFCP()', async function () {

const [fcp2] = await getBeacons();
assert(fcp2.value >= 0);
assert(fcp2.id.match(/^v4-\d+-\d+$/));
assert(fcp2.id.match(/^v5-\d+-\d+$/));
assert(fcp2.id !== fcp1.id);
assert.strictEqual(fcp2.name, 'FCP');
assert.strictEqual(fcp2.value, fcp2.delta);
Expand All @@ -199,7 +199,7 @@ describe('onFCP()', async function () {

const [fcp3] = await getBeacons();
assert(fcp3.value >= 0);
assert(fcp3.id.match(/^v4-\d+-\d+$/));
assert(fcp3.id.match(/^v5-\d+-\d+$/));
assert(fcp3.id !== fcp2.id);
assert.strictEqual(fcp3.name, 'FCP');
assert.strictEqual(fcp3.value, fcp3.delta);
Expand Down Expand Up @@ -227,7 +227,7 @@ describe('onFCP()', async function () {

const [fcp1] = await getBeacons();
assert(fcp1.value >= 0);
assert(fcp1.id.match(/^v4-\d+-\d+$/));
assert(fcp1.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp1.name, 'FCP');
assert.strictEqual(fcp1.value, fcp1.delta);
assert.strictEqual(fcp1.rating, 'good');
Expand All @@ -241,7 +241,7 @@ describe('onFCP()', async function () {

const [fcp2] = await getBeacons();
assert(fcp2.value >= 0);
assert(fcp2.id.match(/^v4-\d+-\d+$/));
assert(fcp2.id.match(/^v5-\d+-\d+$/));
assert(fcp2.id !== fcp1.id);
assert.strictEqual(fcp2.name, 'FCP');
assert.strictEqual(fcp2.value, fcp2.delta);
Expand All @@ -259,7 +259,7 @@ describe('onFCP()', async function () {

const [fcp] = await getBeacons();
assert(fcp.value >= 0);
assert(fcp.id.match(/^v4-\d+-\d+$/));
assert(fcp.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp.name, 'FCP');
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'good');
Expand Down Expand Up @@ -287,7 +287,7 @@ describe('onFCP()', async function () {
const [fcp] = await getBeacons();

assert(fcp.value >= 0);
assert(fcp.id.match(/^v4-\d+-\d+$/));
assert(fcp.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp.name, 'FCP');
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'good');
Expand Down Expand Up @@ -335,7 +335,7 @@ describe('onFCP()', async function () {

const [fcp] = await getBeacons();
assert(fcp.value >= 0);
assert(fcp.id.match(/^v4-\d+-\d+$/));
assert(fcp.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp.name, 'FCP');
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'good');
Expand Down Expand Up @@ -378,7 +378,7 @@ describe('onFCP()', async function () {

const [fcp] = await getBeacons();
assert(fcp.value >= 0);
assert(fcp.id.match(/^v4-\d+-\d+$/));
assert(fcp.id.match(/^v5-\d+-\d+$/));
assert.strictEqual(fcp.name, 'FCP');
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'good');
Expand Down
Loading

0 comments on commit be41ea5

Please sign in to comment.