From 069d2f7c2871d0266e9d5815189dab48f3602c30 Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Tue, 3 Jan 2023 22:16:15 +0800 Subject: [PATCH] tests: add 34 tests --- .../data-center/__tests__/attachment.spec.ts | 13 +++++++++++++ packages/data-center/__tests__/auth.spec.ts | 15 +++++++++++++++ .../data-center/__tests__/cloud-sync.spec.ts | 17 +++++++++++++++++ .../__tests__/import-export.spec.ts | 11 +++++++++++ .../{tests => __tests__}/init.spec.ts | 0 packages/data-center/__tests__/search.spec.ts | 9 +++++++++ packages/data-center/__tests__/share.spec.ts | 19 +++++++++++++++++++ .../data-center/{tests => __tests__}/utils.ts | 0 .../{tests => __tests__}/workspace.spec.ts | 10 ++++++++++ 9 files changed, 94 insertions(+) create mode 100644 packages/data-center/__tests__/attachment.spec.ts create mode 100644 packages/data-center/__tests__/auth.spec.ts create mode 100644 packages/data-center/__tests__/cloud-sync.spec.ts create mode 100644 packages/data-center/__tests__/import-export.spec.ts rename packages/data-center/{tests => __tests__}/init.spec.ts (100%) create mode 100644 packages/data-center/__tests__/search.spec.ts create mode 100644 packages/data-center/__tests__/share.spec.ts rename packages/data-center/{tests => __tests__}/utils.ts (100%) rename packages/data-center/{tests => __tests__}/workspace.spec.ts (84%) diff --git a/packages/data-center/__tests__/attachment.spec.ts b/packages/data-center/__tests__/attachment.spec.ts new file mode 100644 index 0000000000..61343d9685 --- /dev/null +++ b/packages/data-center/__tests__/attachment.spec.ts @@ -0,0 +1,13 @@ +import { test, expect } from '@playwright/test'; + +import { getDataCenter } from './utils.js'; + +import 'fake-indexeddb/auto'; + +test.describe('attachment', () => { + test('upload blob', async () => {}); + + test('get blob', async () => {}); + + test('remove blob', async () => {}); +}); diff --git a/packages/data-center/__tests__/auth.spec.ts b/packages/data-center/__tests__/auth.spec.ts new file mode 100644 index 0000000000..fd7e56d78c --- /dev/null +++ b/packages/data-center/__tests__/auth.spec.ts @@ -0,0 +1,15 @@ +import { test, expect } from '@playwright/test'; + +import { getDataCenter } from './utils.js'; + +import 'fake-indexeddb/auto'; + +test.describe('auth', () => { + test('signin', async () => {}); + + test('signout', async () => {}); + + test('isLogin', async () => {}); + + test('getUserInfo', async () => {}); +}); diff --git a/packages/data-center/__tests__/cloud-sync.spec.ts b/packages/data-center/__tests__/cloud-sync.spec.ts new file mode 100644 index 0000000000..0b14361993 --- /dev/null +++ b/packages/data-center/__tests__/cloud-sync.spec.ts @@ -0,0 +1,17 @@ +import { test, expect } from '@playwright/test'; + +import { getDataCenter } from './utils.js'; + +import 'fake-indexeddb/auto'; + +test.describe('cloud-sync', () => { + test('get cloud sync flag of workspace ', async () => {}); + + test('enable cloud sync feature', async () => {}); + + test('close cloud sync feature', async () => {}); + + test('editor collaborate', async () => {}); + + test('editor cloud storage', async () => {}); +}); diff --git a/packages/data-center/__tests__/import-export.spec.ts b/packages/data-center/__tests__/import-export.spec.ts new file mode 100644 index 0000000000..416150ffbc --- /dev/null +++ b/packages/data-center/__tests__/import-export.spec.ts @@ -0,0 +1,11 @@ +import { test, expect } from '@playwright/test'; + +import { getDataCenter } from './utils.js'; + +import 'fake-indexeddb/auto'; + +test.describe('import export', () => { + test('import workspace', async () => {}); + + test('export workspace', async () => {}); +}); diff --git a/packages/data-center/tests/init.spec.ts b/packages/data-center/__tests__/init.spec.ts similarity index 100% rename from packages/data-center/tests/init.spec.ts rename to packages/data-center/__tests__/init.spec.ts diff --git a/packages/data-center/__tests__/search.spec.ts b/packages/data-center/__tests__/search.spec.ts new file mode 100644 index 0000000000..5973fb880c --- /dev/null +++ b/packages/data-center/__tests__/search.spec.ts @@ -0,0 +1,9 @@ +import { test, expect } from '@playwright/test'; + +import { getDataCenter } from './utils.js'; + +import 'fake-indexeddb/auto'; + +test.describe('search', () => { + test('search service', async () => {}); +}); diff --git a/packages/data-center/__tests__/share.spec.ts b/packages/data-center/__tests__/share.spec.ts new file mode 100644 index 0000000000..cba8689fd5 --- /dev/null +++ b/packages/data-center/__tests__/share.spec.ts @@ -0,0 +1,19 @@ +import { test, expect } from '@playwright/test'; + +import { getDataCenter } from './utils.js'; + +import 'fake-indexeddb/auto'; + +test.describe('share', () => { + test('get the public of workspace', async () => {}); + + test('make workspace public', async () => {}); + + test('make workspace private', async () => {}); + + test('invite member by email', async () => {}); + + test('accept invite member link', async () => {}); + + test('members list', async () => {}); +}); diff --git a/packages/data-center/tests/utils.ts b/packages/data-center/__tests__/utils.ts similarity index 100% rename from packages/data-center/tests/utils.ts rename to packages/data-center/__tests__/utils.ts diff --git a/packages/data-center/tests/workspace.spec.ts b/packages/data-center/__tests__/workspace.spec.ts similarity index 84% rename from packages/data-center/tests/workspace.spec.ts rename to packages/data-center/__tests__/workspace.spec.ts index 99f47abf54..3278fe10e4 100644 --- a/packages/data-center/tests/workspace.spec.ts +++ b/packages/data-center/__tests__/workspace.spec.ts @@ -48,4 +48,14 @@ test.describe('workspace', () => { await dataCenter.delete('test9'); expect(await dataCenter.list()).toStrictEqual(['test10']); }); + + test('create workspace', async () => {}); + test('get the workspace', async () => {}); + + test('get workspace name', async () => {}); + test('set workspace name', async () => {}); + + test('get workspace avatar', async () => {}); + + test('set workspace avatar', async () => {}); });