Ocelot-Social/webapp/pages/settings.spec.js
sebastian2357 2fd138697f
feat(webapp): badges UI (#8426)
- New badge UI, including editor.
- Adds config to enable/disable badges.

---------

Co-authored-by: Sebastian Stein <sebastian@codepassion.de>
Co-authored-by: Maximilian Harz <maxharz@gmail.com>
2025-04-25 16:55:46 +00:00

54 lines
906 B
JavaScript

import { render } from '@testing-library/vue'
import settings from './settings.vue'
const localVue = global.localVue
const stubs = {
'nuxt-child': true,
}
describe('settings.vue', () => {
let wrapper
let mocks
beforeEach(() => {
mocks = {
$t: jest.fn(),
}
})
const Wrapper = () => {
return render(settings, {
mocks,
localVue,
stubs,
})
}
describe('given badges are enabled', () => {
beforeEach(() => {
mocks.$env = {
BADGES_ENABLED: true,
}
wrapper = Wrapper()
})
it('renders', () => {
expect(wrapper.container).toMatchSnapshot()
})
})
describe('given badges are disabled', () => {
beforeEach(() => {
mocks.$env = {
BADGES_ENABLED: false,
}
wrapper = Wrapper()
})
it('renders', () => {
expect(wrapper.container).toMatchSnapshot()
})
})
})