Skip to content
Snippets Groups Projects
Commit 32dd6ea0 authored by Victor Löfgren's avatar Victor Löfgren
Browse files

Fix client tests

parent b6d3752a
No related branches found
No related tags found
1 merge request!64Resolve "Add Socketio"
Pipeline #41032 passed with warnings
......@@ -20,6 +20,11 @@ const initialState = {
title: '',
},
teams: [],
code: '',
timer: {
enabled: false,
value: 0,
},
}
it('should return the initial state', () => {
......@@ -46,7 +51,9 @@ it('should handle SET_PRESENTATION_COMPETITION', () => {
).toEqual({
competition: testCompetition,
slide: testCompetition.slides[0],
teams: [],
teams: initialState.teams,
code: initialState.code,
timer: initialState.timer,
})
})
......@@ -70,6 +77,8 @@ it('should handle SET_PRESENTATION_TEAMS', () => {
competition: initialState.competition,
slide: initialState.slide,
teams: testTeams,
code: initialState.code,
timer: initialState.timer,
})
})
......@@ -92,6 +101,8 @@ it('should handle SET_PRESENTATION_SLIDE', () => {
competition: initialState.competition,
slide: testSlide,
teams: initialState.teams,
code: initialState.code,
timer: initialState.timer,
})
})
......@@ -107,6 +118,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => {
},
teams: initialState.teams,
slide: { competition_id: 0, order: 1 } as Slide,
code: initialState.code,
timer: initialState.timer,
}
expect(
presentationReducer(testPresentationState, {
......@@ -116,6 +129,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => {
competition: testPresentationState.competition,
slide: testPresentationState.competition.slides[0],
teams: testPresentationState.teams,
code: initialState.code,
timer: initialState.timer,
})
})
it('by not changing slide if there is no previous one', () => {
......@@ -129,6 +144,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => {
},
teams: initialState.teams,
slide: { competition_id: 0, order: 0 } as Slide,
code: initialState.code,
timer: initialState.timer,
}
expect(
presentationReducer(testPresentationState, {
......@@ -138,6 +155,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => {
competition: testPresentationState.competition,
slide: testPresentationState.competition.slides[0],
teams: testPresentationState.teams,
code: initialState.code,
timer: initialState.timer,
})
})
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment