Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sparesti-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106_2024_01
sparesti-frontend
Merge requests
!15
Profile view validation
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Profile view validation
profile-view-validation
into
development
Overview
0
Commits
3
Pipelines
1
Changes
2
Merged
Agnethe Kval-Engstad
requested to merge
profile-view-validation
into
development
1 year ago
Overview
0
Commits
3
Pipelines
1
Changes
2
Expand
0
0
Merge request reports
Compare
development
development (base)
and
latest version
latest version
a83b9e4e
3 commits,
1 year ago
2 files
+
112
−
72
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/views/__tests__/ProfileView.spec.js
+
2
−
46
Options
@@ -7,63 +7,19 @@ describe('Testing of ProfileView', () => {
@@ -7,63 +7,19 @@ describe('Testing of ProfileView', () => {
const
wrapper
=
mount
(
ProfileView
,
const
wrapper
=
mount
(
ProfileView
,
{
{
global
:
{
global
:
{
stubs
:
[
'
RouterLink
'
]
stubs
:
[
'
RouterLink
'
,
'
Input
'
]
}
}
})
})
expect
(
wrapper
.
exists
()).
toBe
(
true
)
expect
(
wrapper
.
exists
()).
toBe
(
true
)
})
})
it
(
'
toggles editing mode when button is clicked
'
,
async
()
=>
{
const
wrapper
=
mount
(
ProfileView
,
{
global
:
{
stubs
:
[
'
RouterLink
'
]
}
})
expect
(
wrapper
.
vm
.
isEditing
).
toBe
(
false
)
await
wrapper
.
find
(
'
button
'
).
trigger
(
'
click
'
)
expect
(
wrapper
.
vm
.
isEditing
).
toBe
(
true
)
})
it
(
'
displays "Lagre" when in editing mode
'
,
async
()
=>
{
const
wrapper
=
mount
(
ProfileView
,
{
global
:
{
stubs
:
[
'
RouterLink
'
]
}
})
await
wrapper
.
find
(
'
button
'
).
trigger
(
'
click
'
)
expect
(
wrapper
.
find
(
'
button
'
).
text
()).
toBe
(
'
Lagre
'
)
})
it
(
'
displays "Rediger" when not in editing mode
'
,
()
=>
{
it
(
'
displays "Rediger" when not in editing mode
'
,
()
=>
{
const
wrapper
=
mount
(
ProfileView
,
const
wrapper
=
mount
(
ProfileView
,
{
{
global
:
{
global
:
{
stubs
:
[
'
RouterLink
'
]
stubs
:
[
'
RouterLink
'
,
'
Input
'
]
}
}
})
})
expect
(
wrapper
.
find
(
'
button
'
).
text
()).
toBe
(
'
Rediger
'
)
expect
(
wrapper
.
find
(
'
button
'
).
text
()).
toBe
(
'
Rediger
'
)
})
})
it
(
'
has border class on input fields when in editing mode
'
,
async
()
=>
{
const
wrapper
=
mount
(
ProfileView
,
{
global
:
{
stubs
:
[
'
RouterLink
'
]
}
})
await
wrapper
.
find
(
'
button
'
).
trigger
(
'
click
'
)
expect
(
wrapper
.
find
(
'
input
'
).
classes
()).
toContain
(
'
border
'
)
})
it
(
'
does not have border class on input fields when not in editing mode
'
,
()
=>
{
const
wrapper
=
mount
(
ProfileView
,
{
global
:
{
stubs
:
[
'
RouterLink
'
]
}
})
expect
(
wrapper
.
find
(
'
input
'
).
classes
()).
not
.
toContain
(
'
border
'
)
})
})
})
\ No newline at end of file
Loading