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 = { ...@@ -20,6 +20,11 @@ const initialState = {
title: '', title: '',
}, },
teams: [], teams: [],
code: '',
timer: {
enabled: false,
value: 0,
},
} }
it('should return the initial state', () => { it('should return the initial state', () => {
...@@ -46,7 +51,9 @@ it('should handle SET_PRESENTATION_COMPETITION', () => { ...@@ -46,7 +51,9 @@ it('should handle SET_PRESENTATION_COMPETITION', () => {
).toEqual({ ).toEqual({
competition: testCompetition, competition: testCompetition,
slide: testCompetition.slides[0], slide: testCompetition.slides[0],
teams: [], teams: initialState.teams,
code: initialState.code,
timer: initialState.timer,
}) })
}) })
...@@ -70,6 +77,8 @@ it('should handle SET_PRESENTATION_TEAMS', () => { ...@@ -70,6 +77,8 @@ it('should handle SET_PRESENTATION_TEAMS', () => {
competition: initialState.competition, competition: initialState.competition,
slide: initialState.slide, slide: initialState.slide,
teams: testTeams, teams: testTeams,
code: initialState.code,
timer: initialState.timer,
}) })
}) })
...@@ -92,6 +101,8 @@ it('should handle SET_PRESENTATION_SLIDE', () => { ...@@ -92,6 +101,8 @@ it('should handle SET_PRESENTATION_SLIDE', () => {
competition: initialState.competition, competition: initialState.competition,
slide: testSlide, slide: testSlide,
teams: initialState.teams, teams: initialState.teams,
code: initialState.code,
timer: initialState.timer,
}) })
}) })
...@@ -107,6 +118,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => { ...@@ -107,6 +118,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => {
}, },
teams: initialState.teams, teams: initialState.teams,
slide: { competition_id: 0, order: 1 } as Slide, slide: { competition_id: 0, order: 1 } as Slide,
code: initialState.code,
timer: initialState.timer,
} }
expect( expect(
presentationReducer(testPresentationState, { presentationReducer(testPresentationState, {
...@@ -116,6 +129,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => { ...@@ -116,6 +129,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => {
competition: testPresentationState.competition, competition: testPresentationState.competition,
slide: testPresentationState.competition.slides[0], slide: testPresentationState.competition.slides[0],
teams: testPresentationState.teams, teams: testPresentationState.teams,
code: initialState.code,
timer: initialState.timer,
}) })
}) })
it('by not changing slide if there is no previous one', () => { it('by not changing slide if there is no previous one', () => {
...@@ -129,6 +144,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => { ...@@ -129,6 +144,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => {
}, },
teams: initialState.teams, teams: initialState.teams,
slide: { competition_id: 0, order: 0 } as Slide, slide: { competition_id: 0, order: 0 } as Slide,
code: initialState.code,
timer: initialState.timer,
} }
expect( expect(
presentationReducer(testPresentationState, { presentationReducer(testPresentationState, {
...@@ -138,6 +155,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => { ...@@ -138,6 +155,8 @@ describe('should handle SET_PRESENTATION_SLIDE_PREVIOUS', () => {
competition: testPresentationState.competition, competition: testPresentationState.competition,
slide: testPresentationState.competition.slides[0], slide: testPresentationState.competition.slides[0],
teams: testPresentationState.teams, 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.
Please register or to comment