Skip to content
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
4 changes: 2 additions & 2 deletions bin/plugin/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const { confirm } = require( '@inquirer/prompts' );
const fs = require( 'fs' );
const childProcess = require( 'child_process' );
const { v4: uuid } = require( 'uuid' );
const { randomUUID } = require( 'crypto' );
const path = require( 'path' );
const os = require( 'os' );

Expand Down Expand Up @@ -123,7 +123,7 @@ async function askForConfirmation(
* @return {string} Temporary Path.
*/
function getRandomTemporaryPath() {
return path.join( os.tmpdir(), uuid() );
return path.join( os.tmpdir(), randomUUID() );
}

/**
Expand Down
101 changes: 4 additions & 97 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
"style-loader": "3.2.1",
"stylelint-plugin-logical-css": "^1.2.3",
"typescript": "6.0.2",
"uuid": "11.1.1",
"wait-on": "8.0.1"
},
"overrides": {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/blocks/classic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const path = require( 'path' );
const fs = require( 'fs/promises' );
const os = require( 'os' );
const { v4: uuid } = require( 'uuid' );
const { randomUUID } = require( 'crypto' );

/**
* WordPress dependencies
Expand Down Expand Up @@ -158,7 +158,7 @@ class MediaUtils {
const tmpDirectory = await fs.mkdtemp(
path.join( os.tmpdir(), 'gutenberg-test-image-' )
);
const fileName = uuid();
const fileName = randomUUID();
const tmpFileName = path.join( tmpDirectory, fileName + '.png' );
await fs.copyFile( this.TEST_IMAGE_FILE_PATH, tmpFileName );

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/blocks/cover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const path = require( 'path' );
const fs = require( 'fs/promises' );
const os = require( 'os' );
const { v4: uuid } = require( 'uuid' );
const { randomUUID } = require( 'crypto' );

/** @typedef {import('@playwright/test').Page} Page */

Expand Down Expand Up @@ -576,7 +576,7 @@ class CoverBlockUtils {
const tmpDirectory = await fs.mkdtemp(
path.join( os.tmpdir(), 'gutenberg-test-image-' )
);
const fileName = uuid();
const fileName = randomUUID();
const tmpFileName = path.join( tmpDirectory, fileName + '.png' );
await fs.copyFile( srcPath, tmpFileName );

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/blocks/gallery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const path = require( 'path' );
const fs = require( 'fs/promises' );
const os = require( 'os' );
const { v4: uuid } = require( 'uuid' );
const { randomUUID } = require( 'crypto' );

/**
* WordPress dependencies
Expand Down Expand Up @@ -295,7 +295,7 @@ class GalleryBlockUtils {
const tmpDirectory = await fs.mkdtemp(
path.join( os.tmpdir(), 'gutenberg-test-image-' )
);
const fileName = uuid();
const fileName = randomUUID();
const tmpFileName = path.join( tmpDirectory, fileName + '.png' );
await fs.copyFile( this.TEST_IMAGE_FILE_PATH, tmpFileName );

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/blocks/image.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const path = require( 'path' );
const fs = require( 'fs/promises' );
const os = require( 'os' );
const { v4: uuid } = require( 'uuid' );
const { randomUUID } = require( 'crypto' );

/** @typedef {import('@playwright/test').Page} Page */

Expand Down Expand Up @@ -1153,7 +1153,7 @@ class ImageBlockUtils {
const tmpDirectory = await fs.mkdtemp(
path.join( os.tmpdir(), 'gutenberg-test-image-' )
);
const fileName = uuid();
const fileName = randomUUID();
const tmpFileName = path.join( tmpDirectory, fileName + '.png' );
const filePath = customFile
? this.basePath + '/' + customFile
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/adding-inline-tokens.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* External dependencies
*/
import { randomUUID } from 'crypto';
import fs from 'fs';
import os from 'os';
import path from 'path';
import { v4 as uuid } from 'uuid';

/**
* WordPress dependencies
Expand Down Expand Up @@ -33,7 +33,7 @@ test.describe( 'adding inline tokens', () => {
await page.click( 'role=menuitem[name="Inline image"i]' );

const testImagePath = './assets/10x10_e2e_test_image_z9T8jK.png';
const fileName = uuid();
const fileName = randomUUID();
const tmpFileName = path.join( os.tmpdir(), fileName + '.png' );
fs.copyFileSync( testImagePath, tmpFileName );
await page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const path = require( 'path' );
const fs = require( 'fs/promises' );
const os = require( 'os' );
const { v4: uuid } = require( 'uuid' );
const { randomUUID } = require( 'crypto' );

/**
* WordPress dependencies
Expand Down Expand Up @@ -232,7 +232,7 @@ class ImageBlockUtils {
const tmpDirectory = await fs.mkdtemp(
path.join( os.tmpdir(), 'gutenberg-test-image-' )
);
const fileName = uuid();
const fileName = randomUUID();
const extension = customFile ? path.extname( customFile ) : '.png';
const tmpFileName = path.join( tmpDirectory, fileName + extension );
const filePath = customFile
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/upload-save-lock.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const path = require( 'path' );
const fs = require( 'fs/promises' );
const os = require( 'os' );
const { v4: uuid } = require( 'uuid' );
const { randomUUID } = require( 'crypto' );

/**
* WordPress dependencies
Expand All @@ -29,7 +29,7 @@
const tmpDirectory = await fs.mkdtemp(
path.join( os.tmpdir(), 'gutenberg-test-image-' )
);
const tmpFileName = path.join( tmpDirectory, uuid() + '.png' );
const tmpFileName = path.join( tmpDirectory, randomUUID() + '.png' );
await fs.copyFile( TEST_IMAGE_FILE_PATH, tmpFileName );
return tmpFileName;
}
Expand Down Expand Up @@ -161,7 +161,7 @@
.toBe( true );

// Save draft should be disabled while uploads are in progress.
await expect( saveDraftButton ).toBeDisabled();

Check failure on line 164 in test/e2e/specs/editor/various/upload-save-lock.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 5

[chromium] › specs/editor/various/upload-save-lock.spec.js:116:2 › Upload save lock › should disable Save draft button during a multi-file gallery upload

2) [chromium] › specs/editor/various/upload-save-lock.spec.js:116:2 › Upload save lock › should disable Save draft button during a multi-file gallery upload Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toBeDisabled() failed Locator: getByRole('region', { name: 'Editor top bar' }).getByRole('button', { name: 'Save draft' }) Expected: disabled Received: enabled Timeout: 5000ms Call log: - Expect "toBeDisabled" with timeout 5000ms - waiting for getByRole('region', { name: 'Editor top bar' }).getByRole('button', { name: 'Save draft' }) 9 × locator resolved to <button type="button" aria-disabled="false" aria-label="Save draft" class="components-button editor-post-save-draft is-compact is-tertiary">Save draft</button> - unexpected value "enabled" 162 | 163 | // Save draft should be disabled while uploads are in progress. > 164 | await expect( saveDraftButton ).toBeDisabled(); | ^ 165 | 166 | // Let all uploads complete. 167 | resolveAllUploads(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/upload-save-lock.spec.js:164:35

Check failure on line 164 in test/e2e/specs/editor/various/upload-save-lock.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 5

[chromium] › specs/editor/various/upload-save-lock.spec.js:116:2 › Upload save lock › should disable Save draft button during a multi-file gallery upload

2) [chromium] › specs/editor/various/upload-save-lock.spec.js:116:2 › Upload save lock › should disable Save draft button during a multi-file gallery upload Error: expect(locator).toBeDisabled() failed Locator: getByRole('region', { name: 'Editor top bar' }).getByRole('button', { name: 'Save draft' }) Expected: disabled Received: enabled Timeout: 5000ms Call log: - Expect "toBeDisabled" with timeout 5000ms - waiting for getByRole('region', { name: 'Editor top bar' }).getByRole('button', { name: 'Save draft' }) 9 × locator resolved to <button type="button" aria-disabled="false" aria-label="Save draft" class="components-button editor-post-save-draft is-compact is-tertiary">Save draft</button> - unexpected value "enabled" 162 | 163 | // Save draft should be disabled while uploads are in progress. > 164 | await expect( saveDraftButton ).toBeDisabled(); | ^ 165 | 166 | // Let all uploads complete. 167 | resolveAllUploads(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/upload-save-lock.spec.js:164:35

// Let all uploads complete.
resolveAllUploads();
Expand Down
4 changes: 2 additions & 2 deletions test/native/integration-test-helpers/initialize-editor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* External dependencies
*/
import { randomUUID } from 'crypto';
import { render, fireEvent } from '@testing-library/react-native';
import { v4 as uuid } from 'uuid';

/**
* WordPress dependencies
Expand Down Expand Up @@ -45,7 +45,7 @@ export async function initializeEditor( props, { component } = {} ) {
return actualResolution( selectorName, args );
} );

const uniqueId = uuid();
const uniqueId = randomUUID();
const postId = `post-id-${ uniqueId }`;
const postType = 'post';

Expand Down
2 changes: 1 addition & 1 deletion test/native/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module.exports = {
// See: https://github.com/wordpress-mobile/gutenberg-mobile/pull/257#discussion_r234978268
// There is no overloading in jest so we need to rewrite the config from react-native-jest-preset:
// https://github.com/facebook/react-native/blob/HEAD/jest-preset.json#L20
'node_modules/(?!(simple-html-tokenizer|(jest-)?react-native|@react-native|react-clone-referenced-element|@react-navigation))',
'node_modules/(?!(simple-html-tokenizer|(jest-)?react-native|@react-native|react-clone-referenced-element|@react-navigation|uuid))',
],
snapshotSerializers: [ '@emotion/jest/serializer' ],
snapshotFormat: {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = {
'^.+\\.m?[jt]sx?$': '<rootDir>/test/unit/scripts/babel-transformer.js',
},
transformIgnorePatterns: [
'/node_modules/(?!(docker-compose|yaml|preact|@preact|parsel-js|comctx)/)',
'/node_modules/(?!(docker-compose|yaml|preact|@preact|parsel-js|comctx|uuid)/)',
'\\.pnp\\.[^\\/]+$',
],
snapshotSerializers: [
Expand Down
Loading
Loading