test: add auth, social login, email verification, and validation tests
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import ErrorBoundary from '../ErrorBoundary.vue'
|
||||
|
||||
// Stub UIcon and UButton since they come from Nuxt UI
|
||||
const stubs = {
|
||||
UIcon: { template: '<span />' },
|
||||
UButton: { template: '<button><slot /></button>' },
|
||||
}
|
||||
|
||||
describe('errorBoundary', () => {
|
||||
it('renders slot content when no error', () => {
|
||||
const wrapper = mount(ErrorBoundary, {
|
||||
slots: {
|
||||
default: '<div>Hello World</div>',
|
||||
},
|
||||
global: { stubs },
|
||||
})
|
||||
|
||||
expect(wrapper.text()).toContain('Hello World')
|
||||
})
|
||||
|
||||
it('does not show error UI by default', () => {
|
||||
const wrapper = mount(ErrorBoundary, {
|
||||
slots: {
|
||||
default: '<div>Content</div>',
|
||||
},
|
||||
global: { stubs },
|
||||
})
|
||||
|
||||
expect(wrapper.text()).not.toContain('Something went wrong')
|
||||
expect(wrapper.text()).toContain('Content')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user