From 3792a4910237a0924bd8088ef16c422dffc2f9e0 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Jun 2023 13:50:48 +0200 Subject: [PATCH] feat(frontend): test right side layout template --- .../src/layouts/templates/RightSide.spec.js | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 frontend/src/layouts/templates/RightSide.spec.js diff --git a/frontend/src/layouts/templates/RightSide.spec.js b/frontend/src/layouts/templates/RightSide.spec.js new file mode 100644 index 000000000..2a24f846b --- /dev/null +++ b/frontend/src/layouts/templates/RightSide.spec.js @@ -0,0 +1,50 @@ +import { mount } from '@vue/test-utils' +import RightSide from './RightSide' + +const localVue = global.localVue + +describe('RightSide', () => { + let wrapper + + const mocks = { + $route: { + path: '/community/contribute', + }, + } + + const Wrapper = () => { + return mount(RightSide, { localVue, mocks }) + } + + describe('at /community/contribute', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('has name set to "community"', () => { + expect(wrapper.vm.name).toBe('community') + }) + }) + + describe('at /settings', () => { + beforeEach(() => { + mocks.$route.path = '/settings' + wrapper = Wrapper() + }) + + it('has name set to "empty"', () => { + expect(wrapper.vm.name).toBe('empty') + }) + }) + + describe('at /overview', () => { + beforeEach(() => { + mocks.$route.path = '/overview' + wrapper = Wrapper() + }) + + it('has name set to "transactions"', () => { + expect(wrapper.vm.name).toBe('transactions') + }) + }) +})