diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4cc8846e..8fb196fc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,6 +33,8 @@ jobs:
with:
path: ./package.json
+ - uses: pnpm/action-setup@v4
+
- name: Cache PNPM modules
uses: actions/cache@v4
id: cache-modules
@@ -43,13 +45,11 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-node-
- - uses: pnpm/action-setup@v4
-
- uses: actions/setup-node@v4
with:
# use the version found in `.nvmrc`
node-version-file: '.nvmrc'
- cache: 'pnpm'
+ # cache: 'pnpm'
- name: Install `node_modules`
if: steps.cache-modules.outputs.cache-hit != 'true'
diff --git a/components/blocks/ResendConfirmationBar/ResendConfirmationBar.vue b/components/blocks/ResendConfirmationBar/ResendConfirmationBar.vue
index beebe576..4dc4d029 100644
--- a/components/blocks/ResendConfirmationBar/ResendConfirmationBar.vue
+++ b/components/blocks/ResendConfirmationBar/ResendConfirmationBar.vue
@@ -1,6 +1,8 @@
diff --git a/components/blocks/cards/ForgotPasswordCard/ForgotPasswordCard.test.ts b/components/blocks/cards/ForgotPasswordCard/ForgotPasswordCard.test.ts
index 8bdad174..8721d5f0 100644
--- a/components/blocks/cards/ForgotPasswordCard/ForgotPasswordCard.test.ts
+++ b/components/blocks/cards/ForgotPasswordCard/ForgotPasswordCard.test.ts
@@ -1,21 +1,12 @@
-import { mockNuxtImport, mountSuspended } from '@nuxt/test-utils/runtime'
+import { mountSuspended } from '@nuxt/test-utils/runtime'
import { getByTestId } from 'root/testUtils'
import ForgotPasswordCard from './ForgotPasswordCard.vue'
-import type { RecoverAccountRequest } from 'lib/api/data-contracts'
-
-mockNuxtImport('useRecoverAccount', () => {
- return async (
- _requestData: RecoverAccountRequest,
- opts: optionalParameters = {},
- ) => {
- const { onOkay } = opts
- if (onOkay) {
- await onOkay()
- }
- }
-})
-afterAll(() => {
+const mockSuccessAccountRecoverCreate = vi.fn(() =>
+ Promise.resolve({ ok: true }),
+)
+
+afterEach(() => {
vi.restoreAllMocks()
})
@@ -52,6 +43,14 @@ describe('', () => {
const username = 'strongbad'
const emailAddress = `strongbad@homestarrunner.com`
+ beforeEach(() => {
+ vi.mock('lib/api/Account', () => ({
+ Account: function Account() {
+ this.recoverCreate = mockSuccessAccountRecoverCreate
+ },
+ }))
+ })
+
it('should emit the close event', async () => {
const wrapper = await mountSuspended(ForgotPasswordCard)
@@ -63,6 +62,7 @@ describe('', () => {
await getByTestId(wrapper, 'reset-password-button').trigger('click')
+ expect(mockSuccessAccountRecoverCreate).toHaveBeenCalled()
expect(wrapper.emitted().close).toBeTruthy()
})
})
diff --git a/components/blocks/cards/ForgotPasswordCard/ForgotPasswordCard.vue b/components/blocks/cards/ForgotPasswordCard/ForgotPasswordCard.vue
index b4d07bd3..55377900 100644
--- a/components/blocks/cards/ForgotPasswordCard/ForgotPasswordCard.vue
+++ b/components/blocks/cards/ForgotPasswordCard/ForgotPasswordCard.vue
@@ -7,6 +7,8 @@ import CardBody from 'elements/cards/CardBody/CardBody.vue'
import CardHeader from 'elements/cards/CardHeader/CardHeader.vue'
import BaseInput from 'elements/inputs/BaseInput/BaseInput.vue'
import { isEmailValid, isUsernameValid } from 'lib/form_helpers'
+import { useModalAlert } from '#imports'
+import { useRecoverAccount } from '~/composables/api'
interface ForgotPasswordCardPops {
modal?: boolean
@@ -21,7 +23,7 @@ const emit = defineEmits<{
(event: 'close' | 'cancelClick'): void
}>()
-const props = withDefaults(defineProps(), {
+withDefaults(defineProps(), {
modal: false,
})
@@ -76,7 +78,7 @@ function resetPassword() {