From 1ba750d89cbd4fd93ec67ccd4ffad6e182e69e69 Mon Sep 17 00:00:00 2001 From: Himself65 Date: Mon, 20 Mar 2023 21:58:23 -0500 Subject: [PATCH] fix: test error (#1628) --- .github/workflows/build.yml | 2 ++ package.json | 1 + tests/parallels/affine-workspace.spec.ts | 4 ++-- yarn.lock | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eaa1edb0e5..e5d2171403 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,6 +86,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Use Node.js 18 uses: actions/setup-node@v3 with: diff --git a/package.json b/package.json index 6eb940fd7a..50e7cc1306 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "happy-dom": "^8.9.0", "husky": "^8.0.3", "lint-staged": "^13.2.0", + "nanoid": "^4.0.1", "nyc": "^15.1.0", "prettier": "^2.8.5", "react": "^18.2.0", diff --git a/tests/parallels/affine-workspace.spec.ts b/tests/parallels/affine-workspace.spec.ts index 873ce25e9d..da84cd5aec 100644 --- a/tests/parallels/affine-workspace.spec.ts +++ b/tests/parallels/affine-workspace.spec.ts @@ -1,5 +1,5 @@ -import { uuidv4 } from '@blocksuite/store'; import { expect } from '@playwright/test'; +import { nanoid } from 'nanoid'; import userA from '../fixtures/userA.json'; import { test } from '../libs/playwright'; @@ -28,7 +28,7 @@ test.describe('affine workspace', () => { await openHomePage(page); const [a] = await createFakeUser(); await loginUser(page, a); - const name = `test-${uuidv4()}`; + const name = `test-${nanoid()}`; await createWorkspace({ name }, page); await page.waitForTimeout(50); await clickSideBarSettingButton(page); diff --git a/yarn.lock b/yarn.lock index a45b05f521..3e3e1a7c4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7390,6 +7390,7 @@ __metadata: happy-dom: ^8.9.0 husky: ^8.0.3 lint-staged: ^13.2.0 + nanoid: ^4.0.1 nyc: ^15.1.0 prettier: ^2.8.5 react: ^18.2.0