Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Merge requests
!97
Resolve "Show components in active competition"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Show components in active competition"
136-show-components-in-active-competition
into
dev
Overview
0
Commits
3
Pipelines
1
Changes
35
Merged
Albin Henriksson
requested to merge
136-show-components-in-active-competition
into
dev
3 years ago
Overview
0
Commits
3
Pipelines
1
Changes
35
Expand
Closes
#136 (closed)
0
0
Merge request reports
Compare
dev
dev (base)
and
latest version
latest version
47c6a051
3 commits,
3 years ago
35 files
+
336
−
228
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
35
Search (e.g. *.vue) (Ctrl+P)
client/src/actions/presentation.test.ts
+
1
−
12
Options
@@ -2,10 +2,9 @@ import mockedAxios from 'axios'
import
expect
from
'
expect
'
// You can use any testing library
import
configureMockStore
from
'
redux-mock-store
'
import
thunk
from
'
redux-thunk
'
import
{
Slide
}
from
'
../interfaces/
Slide
'
import
{
Slide
}
from
'
../interfaces/
ApiModels
'
import
{
getPresentationCompetition
,
getPresentationTeams
,
setCurrentSlide
,
setCurrentSlideNext
,
setCurrentSlidePrevious
,
@@ -26,16 +25,6 @@ it('dispatches no actions when failing to get competitions', async () => {
expect
(
console
.
log
).
toHaveBeenCalled
()
})
it
(
'
dispatches no actions when failing to get teams
'
,
async
()
=>
{
console
.
log
=
jest
.
fn
()
;(
mockedAxios
.
get
as
jest
.
Mock
).
mockImplementation
((
path
:
string
,
params
?:
any
)
=>
{
return
Promise
.
reject
(
new
Error
(
'
getting teams failed
'
))
})
const
store
=
mockStore
({
competitions
:
{
filterParams
:
[]
}
})
await
getPresentationTeams
(
'
0
'
)(
store
.
dispatch
)
expect
(
store
.
getActions
()).
toEqual
([])
expect
(
console
.
log
).
toHaveBeenCalled
()
})
it
(
'
dispatches correct actions when setting slide
'
,
()
=>
{
const
testSlide
:
Slide
=
{
competition_id
:
0
,
id
:
5
,
order
:
5
,
timer
:
20
,
title
:
''
}
const
expectedActions
=
[{
type
:
Types
.
SET_PRESENTATION_SLIDE
,
payload
:
testSlide
}]
Loading