fix(server): add guid compatibility of :space:page variant (#5062)

This commit is contained in:
liuyi
2023-11-24 23:46:09 +08:00
committed by GitHub
parent 91efca107a
commit 9dc2d55a5a
2 changed files with 16 additions and 1 deletions
@@ -70,3 +70,13 @@ test('fix', t => {
t.is(id.workspace, 'ws');
t.is(id.toString(), 'ws:space:sub');
});
test('special case: `wsId:space:page:pageId`', t => {
const id = new DocID('ws:space:page:page');
t.is(id.workspace, 'ws');
t.is(id.guid, 'page');
t.throws(() => new DocID('ws:s:p:page'));
t.throws(() => new DocID('ws:space:b:page'));
t.throws(() => new DocID('ws:s:page:page'));
});