chore(server): data mocking and seeding (#10864)

This commit is contained in:
liuyi
2025-03-17 14:15:34 +08:00
committed by GitHub
parent 81af7a0571
commit 0f83566504
24 changed files with 449 additions and 82 deletions
@@ -29,8 +29,8 @@ test.after.always(async () => {
});
test('should mention user in a doc', async t => {
const member = await app.signup();
const owner = await app.signup();
const member = await app.signupV1();
const owner = await app.signupV1();
await app.switchUser(owner);
const workspace = await createWorkspace(app);
@@ -161,8 +161,8 @@ test('should mention doc mode support string value', async t => {
});
test('should throw error when mention user has no Doc.Read role', async t => {
const member = await app.signup();
const owner = await app.signup();
const member = await app.signupV1();
const owner = await app.signupV1();
await app.switchUser(owner);
const workspace = await createWorkspace(app);
@@ -187,7 +187,7 @@ test('should throw error when mention user has no Doc.Read role', async t => {
});
test('should throw error when mention a not exists user', async t => {
const owner = await app.signup();
const owner = await app.signupV1();
const workspace = await createWorkspace(app);
await app.switchUser(owner);
const docId = randomUUID();
@@ -209,7 +209,7 @@ test('should throw error when mention a not exists user', async t => {
});
test('should not mention user oneself', async t => {
const owner = await app.signup();
const owner = await app.signupV1();
const workspace = await createWorkspace(app);
await app.switchUser(owner);
await t.throwsAsync(
@@ -230,8 +230,8 @@ test('should not mention user oneself', async t => {
});
test('should mark notification as read', async t => {
const member = await app.signup();
const owner = await app.signup();
const member = await app.signupV1();
const owner = await app.signupV1();
await app.switchUser(owner);
const workspace = await createWorkspace(app);
@@ -273,8 +273,8 @@ test('should mark notification as read', async t => {
});
test('should throw error when read the other user notification', async t => {
const member = await app.signup();
const owner = await app.signup();
const member = await app.signupV1();
const owner = await app.signupV1();
await app.switchUser(owner);
const workspace = await createWorkspace(app);
@@ -356,8 +356,8 @@ test('should throw error when mention mode value is invalid', async t => {
});
test('should list and count notifications', async t => {
const member = await app.signup();
const owner = await app.signup();
const member = await app.signupV1();
const owner = await app.signupV1();
{
await app.switchUser(member);