mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 22:38:56 +08:00
chore(server): data mocking and seeding (#10864)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user