diff --git a/test/unit/specs/boot/routes.spec.js b/test/unit/specs/boot/routes.spec.js index f4be28a65..2f341bb48 100644 --- a/test/unit/specs/boot/routes.spec.js +++ b/test/unit/specs/boot/routes.spec.js @@ -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') }) }) diff --git a/test/unit/specs/components/draft.spec.js b/test/unit/specs/components/draft.spec.js index 6abf2d75b..be2400fc3 100644 --- a/test/unit/specs/components/draft.spec.js +++ b/test/unit/specs/components/draft.spec.js @@ -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')