Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-barraza committed Mar 3, 2025
1 parent 69980f5 commit daad0cf
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions auth-web/tests/unit/components/ProductPayment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { createLocalVue, mount } from '@vue/test-utils'
import ProductPackage from '@/components/auth/account-settings/product/ProductPayment.vue'
import VueRouter from 'vue-router'
import Vuetify from 'vuetify'
import flushPromises from 'flush-promises'
import { useOrgStore } from '@/stores/org'
import { useUserStore } from '@/stores/user'

Expand Down Expand Up @@ -89,17 +88,14 @@ describe('Account settings ProductPackage.vue', () => {
it('handles modal dialog add product correctly', async () => {
const orgStore = useOrgStore()

orgStore.addOrgProducts = vi.fn().mockResolvedValue({})

wrapper.vm.$refs.confirmDialog = { open: vi.fn() }

await wrapper.vm.$nextTick()
orgStore.currentSelectedProducts = [{ code: 'TEST_PRODUCT' }]
wrapper.vm.addProductOnAccountAdmin = true
const mockOpen = vi.fn()
wrapper.vm.$refs.confirmDialog.open = mockOpen

await wrapper.vm.submitProductRequest()
await flushPromises()

expect(wrapper.vm.$refs.confirmDialog.open).toHaveBeenCalled()
expect(mockOpen).toHaveBeenCalled()
expect(wrapper.vm.dialogTitle).toBe('Product Added')
expect(wrapper.vm.dialogText).toBe('Your account now has access to the selected product.')
expect(wrapper.vm.dialogError).toBe(false)
Expand Down

0 comments on commit daad0cf

Please # to comment.