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
Commits
575b2fc8
Commit
575b2fc8
authored
4 years ago
by
Albin Henriksson
Browse files
Options
Downloads
Patches
Plain Diff
Added render test
parent
3d6a07e4
No related branches found
No related tags found
1 merge request
!44
Resolve "test competition view"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/src/pages/admin/components/AddCompetition.test.tsx
+2
-37
2 additions, 37 deletions
client/src/pages/admin/components/AddCompetition.test.tsx
with
2 additions
and
37 deletions
client/src/pages/admin/components/AddCompetition.test.tsx
+
2
−
37
View file @
575b2fc8
import
{
render
,
screen
}
from
'
@testing-library/react
'
import
{
mount
}
from
'
enzyme
'
import
{
render
}
from
'
@testing-library/react
'
import
React
from
'
react
'
import
{
Provider
}
from
'
react-redux
'
import
{
BrowserRouter
}
from
'
react-router-dom
'
import
configureMockStore
from
'
redux-mock-store
'
import
thunk
from
'
redux-thunk
'
import
store
from
'
../../../store
'
import
AddCompetition
from
'
./AddCompetition
'
const
middlewares
=
[
thunk
]
const
mockStore
=
configureMockStore
(
middlewares
)
fit
(
'
renders add competition
'
,
()
=>
{
it
(
'
renders add competition
'
,
()
=>
{
render
(
<
BrowserRouter
>
<
Provider
store
=
{
store
}
>
...
...
@@ -20,32 +14,3 @@ fit('renders add competition', () => {
</
BrowserRouter
>
)
})
fit
(
'
it adds competitions
'
,
()
=>
{
const
cities
=
[
{
id
:
1
,
name
:
'
Link
\
u00f6ping
'
,
},
{
id
:
2
,
name
:
'
Stockholm
'
,
},
]
const
store
=
mockStore
({
cities
})
// console.log(store.getState())
const
wrapper
=
mount
(
<
Provider
store
=
{
store
}
>
<
AddCompetition
/>
</
Provider
>
)
const
newCompetitionButton
=
wrapper
.
find
(
'
button
'
)
newCompetitionButton
.
simulate
(
'
click
'
)
const
nameField
=
screen
.
getByRole
(
'
textbox
'
)
// const nameField = textFields.children().first()
// nameField.simulate('focus')
// nameField.simulate('change', { target: { value: 'Changed' } })
console
.
log
(
nameField
)
expect
(
wrapper
.
text
().
includes
(
'
2
'
)).
toBe
(
true
)
//TODO: check that SlideSettings exists
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment