AI: address issue #483
このコミットが含まれているのは:
@@ -56,4 +56,20 @@ describe ('Portable static mirror assets', () => {
|
||||
expect (document.querySelector ('a:not([data-original])'))
|
||||
.toHaveAttribute ('href', 'ja/posts/index.html')
|
||||
})
|
||||
|
||||
it.each (['tag name', 'alias']) ('finds linked posts by %s', async query => {
|
||||
const input = document.querySelector ('input')!
|
||||
input.value = query
|
||||
vi.stubGlobal ('fetch', vi.fn ().mockResolvedValue ({ ok: true, json: async () => [
|
||||
{ path: 'ja/posts/1/index.html', title: 'Post title', names: ['Tag Name', 'Alias'] },
|
||||
{ path: 'ja/posts/2/index.html', title: 'Unrelated post', names: ['Other tag'] },
|
||||
{ path: 'ja/tags/1/index.html', title: 'Tag Name', names: ['Tag Name', 'Alias'] }] }))
|
||||
new Function (script) ()
|
||||
fireEvent.submit (document.querySelector ('form')!)
|
||||
await waitFor (() => expect (document.querySelectorAll ('#search-results a')).toHaveLength (2))
|
||||
const links = [...document.querySelectorAll ('#search-results a')]
|
||||
expect (links.map (link => link.getAttribute ('href')))
|
||||
.toEqual (['ja/posts/1/index.html', 'ja/tags/1/index.html'])
|
||||
expect (links[0].textContent).toBe ('Post title')
|
||||
})
|
||||
})
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする