Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlovesgithub committed Oct 5, 2020
1 parent 0ee298d commit 76cfbfe
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/unit/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ const mocks = {
store: {
dispatch: jest.fn(),
state: {
auth: {
currentUser: {
role: 'superadmin',
}
},
vacancy: {
record: {
typeOfExercise: null,
referenceNumber: null,
isCourtOrTribunal: null,
appointmentType: null,
welshRequirement: null,
unknownVariable: null,
},
},
candidate: {
Expand All @@ -32,6 +38,11 @@ const mocks = {
applications: {
records: [],
},
qualifyingTest: {
record: {
title: null,
},
},
},
getters: {
'vacancy/getCloseDate': new Date(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import Review from '@/views/Exercises/Tasks/QualifyingTests/QualifyingTest/Review.vue';
import { createTestSubject } from '@/../tests/unit/helpers';

const mockTestQuestions = {
introduction: 'Hello',
questions: [
{
type: 'critical-analysis',
details: 'I am the first question',
options: [
'I am the first option',
'I am the second option',
'I am the third option',
'I am the fourth option',
],
'correct': 0,
},
],
};

const mockQualifyingTest = {
title: 'mockQtTitle',
id: '1111',
mode: 'mode',
type: 'critical-analysis',
status: 'started',
startDate: new Date('111'),
endDate: new Date('222'),
testDuration: 222,
additionalInstructions: [
{
text: 'one',
},
{
text: 'two',
},
],
testQuestions: mockTestQuestions,
};

describe('@/views/Exercises/Tasks/QualifyingTests/QualifyingTest/Review', () => {

describe('component instance', () => {
let wrapper;

beforeEach(() => {
wrapper = createTestSubject(Review, {
mocks: {},
stubs: [],
propsData: {
},
});
wrapper.vm.$store.state.qualifyingTest.record = mockQualifyingTest;
});

describe('template', () => {
it('renders the component', () => {
console.log(wrapper.html());
expect(wrapper.exists()).toBe(true);
});
});

});

});

0 comments on commit 76cfbfe

Please sign in to comment.