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
ea9a2c12
Commit
ea9a2c12
authored
3 years ago
by
Albin Henriksson
Browse files
Options
Downloads
Patches
Plain Diff
Fix test path
parent
92b5f54c
No related branches found
No related tags found
1 merge request
!131
Resolve "Increase client test coverage"
Pipeline
#44386
failed
3 years ago
Stage: setup
Stage: test
Stage: report
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/package.json
+2
-1
2 additions, 1 deletion
client/package.json
client/src/e2e/LoginPage.test.tsx
+1
-1
1 addition, 1 deletion
client/src/e2e/LoginPage.test.tsx
client/src/pages/views/components/SocketTest.tsx
+0
-61
0 additions, 61 deletions
client/src/pages/views/components/SocketTest.tsx
with
3 additions
and
63 deletions
client/package.json
+
2
−
1
View file @
ea9a2c12
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
"eject"
:
"react-scripts eject"
,
"eject"
:
"react-scripts eject"
,
"lint"
:
"eslint
\"
./src/**/*.{ts,tsx}
\"
"
,
"lint"
:
"eslint
\"
./src/**/*.{ts,tsx}
\"
"
,
"test:coverage"
:
"react-scripts test --coverage --coverageDirectory=output/coverage/jest"
,
"test:coverage"
:
"react-scripts test --coverage --coverageDirectory=output/coverage/jest"
,
"unit-test:coverage:html"
:
"npm test -- --testPath
Pattern=src/pages --testPath
Pattern=src/
util
--coverage --watchAll=false --coverageDirectory=output/coverage/jest"
,
"unit-test:coverage:html"
:
"npm test -- --testPath
Ignore
Pattern
s
=src/
e2e
--coverage --watchAll=false --coverageDirectory=output/coverage/jest"
,
"e2e-test"
:
"npm test -- --testPathPattern=src/e2e"
"e2e-test"
:
"npm test -- --testPathPattern=src/e2e"
},
},
"browserslist"
:
{
"browserslist"
:
{
...
@@ -91,6 +91,7 @@
...
@@ -91,6 +91,7 @@
"collectCoverageFrom"
:
[
"collectCoverageFrom"
:
[
"src/**/*.{tsx,ts}"
,
"src/**/*.{tsx,ts}"
,
"!src/index.tsx"
,
"!src/index.tsx"
,
"!src/e2e/*"
,
"!src/reportWebVitals.ts"
,
"!src/reportWebVitals.ts"
,
"!src/components/TestConnection.tsx"
"!src/components/TestConnection.tsx"
],
],
...
...
This diff is collapsed.
Click to expand it.
client/src/e2e/LoginPage.test.tsx
+
1
−
1
View file @
ea9a2c12
...
@@ -16,7 +16,7 @@ describe('Login page', () => {
...
@@ -16,7 +16,7 @@ describe('Login page', () => {
})
})
page
=
await
browser
.
newPage
()
page
=
await
browser
.
newPage
()
//Navigate to login screen
and log in
//Navigate to login screen
await
page
.
goto
(
CLIENT_URL
)
await
page
.
goto
(
CLIENT_URL
)
await
page
.
waitForSelector
(
'
.MuiFormControl-root
'
)
await
page
.
waitForSelector
(
'
.MuiFormControl-root
'
)
})
})
...
...
This diff is collapsed.
Click to expand it.
client/src/pages/views/components/SocketTest.tsx
deleted
100644 → 0
+
0
−
61
View file @
92b5f54c
import
React
,
{
useEffect
}
from
'
react
'
import
{
connect
}
from
'
react-redux
'
import
{
useAppDispatch
}
from
'
../../../hooks
'
import
{
socketConnect
,
socketEndPresentation
,
socketJoinPresentation
,
socketSetSlideNext
,
socketSetSlidePrev
,
socketStartPresentation
,
socketStartTimer
,
}
from
'
../../../sockets
'
const
mapStateToProps
=
(
state
:
any
)
=>
{
return
{
slide_order
:
state
.
presentation
.
slide
.
order
,
}
}
const
mapDispatchToProps
=
(
dispatch
:
any
)
=>
{
return
{
// tickTimer: () => dispatch(tickTimer(1)),
}
}
const
SocketTest
:
React
.
FC
=
(
props
:
any
)
=>
{
const
dispatch
=
useAppDispatch
()
useEffect
(()
=>
{
socketConnect
()
// dispatch(getPresentationCompetition('1')) // TODO: Use ID of item_code gotten from auth/login/<code> api call
// dispatch(getPresentationTeams('1')) // TODO: Use ID of item_code gotten from auth/login/<code> api call
},
[])
return
(
<>
<
button
onClick
=
{
socketStartPresentation
}
>
Start presentation
</
button
>
<
button
onClick
=
{
socketJoinPresentation
}
>
Join presentation
</
button
>
<
button
onClick
=
{
socketEndPresentation
}
>
End presentation
</
button
>
<
button
onClick
=
{
socketSetSlidePrev
}
>
Prev slide
</
button
>
<
button
onClick
=
{
socketSetSlideNext
}
>
Next slide
</
button
>
<
button
onClick
=
{
socketStartTimer
}
>
Start timer
</
button
>
<
div
>
Current slide:
{
props
.
slide_order
}
</
div
>
{
/* <div>Timer: {props.timer.value}</div>
<div>Enabled: {props.timer.enabled.toString()}</div>
<button onClick={syncTimer}>Sync</button>
<button onClick={() => dispatch(setTimer(5))}>5 Sec</button>
<button
onClick={() => {
dispatch(setTimer(5))
dispatch(setTimerEnabled(true))
syncTimer()
}}
>
Sync and 5 sec
</button> */
}
</>
)
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
SocketTest
)
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