mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 05:29:08 +08:00
chore: cleanup outdated api (#6604)
This commit is contained in:
@@ -79,26 +79,6 @@ export async function getWorkspace(
|
||||
return res.body.data.workspace;
|
||||
}
|
||||
|
||||
export async function getPublicWorkspace(
|
||||
app: INestApplication,
|
||||
workspaceId: string
|
||||
): Promise<WorkspaceType> {
|
||||
const res = await request(app.getHttpServer())
|
||||
.post(gql)
|
||||
.set({ 'x-request-id': 'test', 'x-operation-name': 'test' })
|
||||
.send({
|
||||
query: `
|
||||
query {
|
||||
publicWorkspace(id: "${workspaceId}") {
|
||||
id
|
||||
}
|
||||
}
|
||||
`,
|
||||
})
|
||||
.expect(200);
|
||||
return res.body.data.publicWorkspace;
|
||||
}
|
||||
|
||||
export async function updateWorkspace(
|
||||
app: INestApplication,
|
||||
token: string,
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
createTestingApp,
|
||||
createWorkspace,
|
||||
currentUser,
|
||||
getPublicWorkspace,
|
||||
getWorkspacePublicPages,
|
||||
inviteUser,
|
||||
publishPage,
|
||||
@@ -87,20 +86,6 @@ test('should can publish workspace', async t => {
|
||||
t.false(isPrivate, 'failed to unpublish workspace');
|
||||
});
|
||||
|
||||
test('should can read published workspace', async t => {
|
||||
const { app } = t.context;
|
||||
const user = await signUp(app, 'u1', 'u1@affine.pro', '1');
|
||||
const workspace = await createWorkspace(app, user.token.token);
|
||||
|
||||
await t.throwsAsync(() => getPublicWorkspace(app, 'not_exists_ws'));
|
||||
await t.throwsAsync(() => getPublicWorkspace(app, workspace.id));
|
||||
|
||||
await updateWorkspace(app, user.token.token, workspace.id, true);
|
||||
|
||||
const publicWorkspace = await getPublicWorkspace(app, workspace.id);
|
||||
t.is(publicWorkspace.id, workspace.id, 'failed to get public workspace');
|
||||
});
|
||||
|
||||
test('should share a page', async t => {
|
||||
const { app } = t.context;
|
||||
const u1 = await signUp(app, 'u1', 'u1@affine.pro', '1');
|
||||
|
||||
Reference in New Issue
Block a user