게시물 목록 페이지 전환 로딩 수정

This commit is contained in:
2026-07-24 16:08:09 +09:00
parent b38eb234d8
commit 2d40fc0574
8 changed files with 66 additions and 10 deletions

View File

@@ -0,0 +1,33 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {
shouldStartSiteRouteVeilNavigation,
shouldUseSiteRouteVeil
} from '../lib/site-route-transition.js'
test('공개 라우트는 전환 베일 대상이고 관리자 라우트는 제외한다', () => {
assert.equal(shouldUseSiteRouteVeil('/posts'), true)
assert.equal(shouldUseSiteRouteVeil('/post/sample'), true)
assert.equal(shouldUseSiteRouteVeil('/admin/posts'), false)
})
test('같은 공개 path의 query 이동은 전환 베일을 시작하지 않는다', () => {
assert.equal(shouldStartSiteRouteVeilNavigation(
{ path: '/posts', fullPath: '/posts?page=3' },
{ path: '/posts', fullPath: '/posts?page=2' }
), false)
})
test('서로 다른 공개 path 이동은 전환 베일을 시작한다', () => {
assert.equal(shouldStartSiteRouteVeilNavigation(
{ path: '/post/sample', fullPath: '/post/sample' },
{ path: '/posts', fullPath: '/posts?page=2' }
), true)
})
test('같은 라우트 이동은 전환 베일을 시작하지 않는다', () => {
assert.equal(shouldStartSiteRouteVeilNavigation(
{ path: '/posts', fullPath: '/posts?page=2' },
{ path: '/posts', fullPath: '/posts?page=2' }
), false)
})