fix tests

This commit is contained in:
Henry Jameson 2026-06-04 22:44:19 +03:00
commit 745981e25f
2 changed files with 20 additions and 29 deletions

View file

@ -38,11 +38,9 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
expect(
Object.hasOwn(
matchedComponents[0].components.default.components,
'UserCard',
),
).to.eql(true)
matchedComponents[0].components.default.name,
).to.eql('AsyncComponentWrapper')
})
it("user's profile at /users", async () => {
@ -51,11 +49,8 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
expect(
Object.hasOwn(
matchedComponents[0].components.default.components,
'UserCard',
),
).to.eql(true)
matchedComponents[0].components.default.name,
).to.eql('AsyncComponentWrapper')
})
it('list view', async () => {
@ -64,11 +59,8 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
expect(
Object.hasOwn(
matchedComponents[0].components.default.components,
'ListsCard',
),
).to.eql(true)
matchedComponents[0].components.default.name,
).to.eql('AsyncComponentWrapper')
})
it('list timeline', async () => {
@ -77,11 +69,8 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
expect(
Object.hasOwn(
matchedComponents[0].components.default.components,
'Timeline',
),
).to.eql(true)
matchedComponents[0].components.default.name,
).to.eql('AsyncComponentWrapper')
})
it('list edit', async () => {
@ -90,10 +79,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
expect(
Object.hasOwn(
matchedComponents[0].components.default.components,
'BasicUserCard',
),
).to.eql(true)
matchedComponents[0].components.default.name,
).to.eql('AsyncComponentWrapper')
})
})

View file

@ -166,10 +166,15 @@ describe('Draft saving', () => {
await textarea.setValue('mew mew')
wrapper.vm.requestClose()
await nextTick()
const saveButton = wrapper.findByText(
'button',
$t('post_status.close_confirm_save_button'),
)
await flushPromises()
const saveButton = await vi.waitFor(() => {
const button = wrapper.findByText(
'button',
$t('post_status.close_confirm_save_button'),
)
if (!button) throw new Error('Save button not present')
return button
})
expect(saveButton).to.be.ok
await saveButton.trigger('click')
console.info('clicked')