feat: add path navigation and shared settings transitions

This commit is contained in:
lezi-fun committed 2026-08-13 12:29:09 +08:00
1 parent caad17d195
commit 84c9e97451
25 files changed
+689 -151

No files matched your search

+10
View File
@@ -23,6 +23,7 @@ let adminToken = null;
let adminId = null;
let userId = null;
let postId = null;
let postNumber = null;
let replyId = null;
const adminUser = { email: `admin${suffix}@test.com`, password: '123456', username: `admin${suffix}` };
@@ -87,7 +88,9 @@ test('发布帖子', async () => {
});
assert.equal(status, 200);
assert.ok(data.id);
assert.ok(Number(data.post_number) >= 1);
postId = data.id;
postNumber = data.post_number;
});
test('帖子列表返回分页结构', async () => {
@@ -110,6 +113,13 @@ test('帖子详情', async () => {
assert.equal(data.title, '测试帖子');
});
test('公开编号可访问同一帖子', async () => {
const { status, data } = await api('/posts/' + postNumber);
assert.equal(status, 200);
assert.equal(data.id, postId);
assert.equal(data.post_number, postNumber);
});
test('不存在的帖子返回 404', async () => {
const { status } = await api('/posts/00000000-0000-0000-0000-000000000000');
assert.equal(status, 404);