Skip to content
Snippets Groups Projects
Commit c65d9026 authored by Albin Henriksson's avatar Albin Henriksson
Browse files

Fix tests

parent c6b5f918
No related branches found
No related tags found
1 merge request!101Resolve "Finish judge view"
Pipeline #42749 passed with warnings
......@@ -74,12 +74,6 @@ const AdminView: React.FC = () => {
dispatch(getRoles())
dispatch(getTypes())
dispatch(getStatistics())
axios.get('/api/competitions/1/codes').then((r) => console.log(r.data.items))
/* axios.post('/api/competitions/1/teams/1/answers', {
question_id: 2,
data: { text: 'Hej svar 2' },
score: 0,
}) */
}, [])
const menuAdminItems = [
......
......@@ -9,7 +9,7 @@ import JudgeViewPage from './JudgeViewPage'
it('renders judge view page', () => {
const compRes: any = {
data: {
slides: [{ id: 0, title: '' }],
slides: [{ id: 0, title: '', questions: [{ id: 0 }] }],
},
}
const teamsRes: any = {
......
......@@ -108,7 +108,7 @@ const JudgeViewPage = ({ competitionId, code }: JudgeViewPageProps) => {
>
<div className={classes.toolbar} />
{currentQuestion && (
<ScoreHeaderPaper rightDrawerWidth={rightDrawerWidth} elevation={4}>
<ScoreHeaderPaper $rightDrawerWidth={rightDrawerWidth} elevation={4}>
<Typography variant="h4">{`${currentQuestion.name} (${currentQuestion.total_score}p)`}</Typography>
</ScoreHeaderPaper>
)}
......
import { AppBar, Button, Drawer, Paper, Toolbar, Typography } from '@material-ui/core'
import { AppBar, Button, Card, Drawer, Paper, Toolbar, Typography } from '@material-ui/core'
import styled from 'styled-components'
export const JudgeAppBar = styled(AppBar)`
......@@ -148,13 +148,13 @@ export const ParticipantContainer = styled.div`
`
interface ScoreHeaderPaperProps {
rightDrawerWidth: number
$rightDrawerWidth: number
}
export const ScoreHeaderPaper = styled(Paper)<ScoreHeaderPaperProps>`
export const ScoreHeaderPaper = styled(Card)<ScoreHeaderPaperProps>`
position: absolute;
top: 66px;
width: ${(props) => (props ? props.rightDrawerWidth : 0)}px;
width: ${(props) => (props ? props.$rightDrawerWidth : 0)}px;
height: 71px;
display: flex;
justify-content: center;
......@@ -163,9 +163,9 @@ export const ScoreHeaderPaper = styled(Paper)<ScoreHeaderPaperProps>`
`
export const ScoreHeaderPadding = styled.div`
height: 93px;
min-height: 71px;
`
export const ScoreFooterPadding = styled.div`
height: 322px;
min-height: 250px;
`
......@@ -6,7 +6,8 @@ import presentationReducer from './presentationReducer'
const initialState = {
competition: {
name: '',
id: 0,
id: 1,
background_image: undefined,
city_id: 0,
slides: [],
year: 0,
......@@ -14,7 +15,8 @@ const initialState = {
},
slide: {
competition_id: 0,
id: 0,
background_image: undefined,
id: -1,
order: 0,
timer: 0,
title: '',
......@@ -48,7 +50,7 @@ it('should handle SET_PRESENTATION_COMPETITION', () => {
})
).toEqual({
competition: testCompetition,
slide: testCompetition.slides[0],
slide: initialState.slide,
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