mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
- 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>
54 lines
906 B
JavaScript
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()
|
|
})
|
|
})
|
|
})
|