diff --git a/frontend/src/components/Transaction.spec.js b/frontend/src/components/Transaction.spec.js new file mode 100644 index 000000000..e5e0c89f0 --- /dev/null +++ b/frontend/src/components/Transaction.spec.js @@ -0,0 +1,36 @@ +import { mount } from '@vue/test-utils' +import Transaction from './Transaction' + +const localVue = global.localVue + +const toastErrorMock = jest.fn() + +describe('Transaction', () => { + let wrapper + + const mocks = { + $i18n: { + locale: 'en', + }, + $t: jest.fn((t) => t), + $n: jest.fn((n) => n), + $d: jest.fn((d) => d), + $toasted: { + error: toastErrorMock, + }, + } + + const Wrapper = () => { + return mount(Transaction, { localVue, mocks }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the component', () => { + expect(wrapper.find('div.gdt-transaction-list-item').exists()).toBeTruthy() + }) + }) +}) diff --git a/frontend/src/components/Transaction.vue b/frontend/src/components/Transaction.vue index e1884a3e3..faf347a41 100644 --- a/frontend/src/components/Transaction.vue +++ b/frontend/src/components/Transaction.vue @@ -1,17 +1,16 @@