게시물 목록 페이지 전환 로딩 수정
This commit is contained in:
33
tests/site-route-transition.test.js
Normal file
33
tests/site-route-transition.test.js
Normal 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)
|
||||
})
|
||||
Reference in New Issue
Block a user