Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
greg
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
it-bott-integrasjoner
greg
Commits
97ea6fb2
Commit
97ea6fb2
authored
3 years ago
by
Tore.Brede
Browse files
Options
Downloads
Patches
Plain Diff
GREG-60: Fixing broken test
parent
f6256b8b
No related branches found
Branches containing commit
No related tags found
1 merge request
!74
GREG-60: Org unit and material UI date picker
Pipeline
#95076
failed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/routes/register/index.test.tsx
+8
-3
8 additions, 3 deletions
frontend/src/routes/register/index.test.tsx
with
8 additions
and
3 deletions
frontend/src/routes/register/index.test.tsx
+
8
−
3
View file @
97ea6fb2
...
...
@@ -3,6 +3,8 @@ import { render, waitFor, screen } from 'test-utils'
import
i18n
from
'
i18next
'
import
{
initReactI18next
}
from
'
react-i18next
'
import
userEvent
from
'
@testing-library/user-event
'
import
AdapterDateFns
from
'
@mui/lab/AdapterDateFns
'
import
{
LocalizationProvider
}
from
'
@mui/lab
'
import
Register
from
'
./index
'
// TODO: can this be initialized in 'test-utils'? should we stub it?
...
...
@@ -21,7 +23,10 @@ i18n.use(initReactI18next).init({
})
test
(
'
Validation message showing if last name is missing
'
,
async
()
=>
{
render
(<
Register
/>)
render
(
<
LocalizationProvider
dateAdapter
=
{
AdapterDateFns
}
>
<
Register
/>
</
LocalizationProvider
>)
const
firstNameLabel
=
i18n
.
t
(
'
input.firstName
'
).
toString
()
const
firstNameComponent
=
screen
.
getByLabelText
(
firstNameLabel
)
...
...
@@ -29,8 +34,8 @@ test('Validation message showing if last name is missing', async () => {
userEvent
.
type
(
firstNameComponent
,
'
Test
'
)
// Try to
submit the form
and check that the validation message is showing
const
submitButton
=
screen
.
getByTestId
(
'
register-
submi
t
'
)
// Try to
go to the next step
and check that the validation message is showing
const
submitButton
=
screen
.
getByTestId
(
'
register-
nex
t
'
)
userEvent
.
click
(
submitButton
)
const
validationLastName
=
i18n
...
...
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