This commit is contained in:
Henry Jameson 2026-02-11 20:42:31 +02:00
commit db2f48a1f9
5 changed files with 17 additions and 11 deletions

View file

@ -1,5 +1,7 @@
import { createTestingPinia } from '@pinia/testing' import { createTestingPinia } from '@pinia/testing'
createTestingPinia()
createTestingPinia()
import { createMemoryHistory, createRouter } from 'vue-router' import { createMemoryHistory, createRouter } from 'vue-router'
import { createStore } from 'vuex' import { createStore } from 'vuex'

View file

@ -1,6 +1,6 @@
import { createTestingPinia } from '@pinia/testing'
import { flushPromises, mount } from '@vue/test-utils' import { flushPromises, mount } from '@vue/test-utils'
import { nextTick } from 'vue' import { nextTick } from 'vue'
import { createTestingPinia } from '@pinia/testing'
import PostStatusForm from 'src/components/post_status_form/post_status_form.vue' import PostStatusForm from 'src/components/post_status_form/post_status_form.vue'
import { $t, mountOpts, waitForEvent } from '../../../fixtures/setup_test' import { $t, mountOpts, waitForEvent } from '../../../fixtures/setup_test'

View file

@ -1,8 +1,9 @@
import { createTestingPinia } from '@pinia/testing'
import { shallowMount } from '@vue/test-utils' import { shallowMount } from '@vue/test-utils'
import vClickOutside from 'click-outside-vue3' import vClickOutside from 'click-outside-vue3'
import { h } from 'vue' import { h } from 'vue'
import { createTestingPinia } from '@pinia/testing'
createTestingPinia() createTestingPinia()
import EmojiInput from 'src/components/emoji_input/emoji_input.vue' import EmojiInput from 'src/components/emoji_input/emoji_input.vue'

View file

@ -1,10 +1,12 @@
import { createTestingPinia } from '@pinia/testing'
import { import {
defaultState, defaultState,
mutations, mutations,
prepareStatus, prepareStatus,
} from '../../../../src/modules/statuses.js' } from '../../../../src/modules/statuses.js'
import { createTestingPinia } from '@pinia/testing'
createTestingPinia() createTestingPinia()
const makeMockStatus = ({ id, text, type = 'status' }) => { const makeMockStatus = ({ id, text, type = 'status' }) => {
return { return {

View file

@ -1,6 +1,6 @@
import { HttpResponse, http } from 'msw'
import { setActivePinia, createPinia } from 'pinia'
import { createTestingPinia } from '@pinia/testing' import { createTestingPinia } from '@pinia/testing'
import { HttpResponse, http } from 'msw'
import { createPinia, setActivePinia } from 'pinia'
import { import {
authApis, authApis,
@ -8,8 +8,8 @@ import {
testServer, testServer,
} from '/test/fixtures/mock_api.js' } from '/test/fixtures/mock_api.js'
import { useOAuthStore } from 'src/stores/oauth.js'
import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceStore } from 'src/stores/instance.js'
import { useOAuthStore } from 'src/stores/oauth.js'
const test = injectMswToTest(authApis) const test = injectMswToTest(authApis)
@ -61,7 +61,6 @@ describe('oauth store', () => {
}), }),
) )
const store = useOAuthStore() const store = useOAuthStore()
store.clientId = 'another-id' store.clientId = 'another-id'
store.clientSecret = 'another-secret' store.clientSecret = 'another-secret'
@ -183,7 +182,9 @@ describe('oauth store', () => {
await expect(store.ensureAppToken()).rejects.toThrowError('Throttled') await expect(store.ensureAppToken()).rejects.toThrowError('Throttled')
}) })
test('it should throw if we cannot obtain app token', async ({ worker }) => { test('it should throw if we cannot obtain app token', async ({
worker,
}) => {
worker.use( worker.use(
http.post(`${testServer}/oauth/token`, () => { http.post(`${testServer}/oauth/token`, () => {
return HttpResponse.text('Throttled', { status: 429 }) return HttpResponse.text('Throttled', { status: 429 })