Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
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 Scrum Team 02
Frontend
Commits
f91b7cc5
Commit
f91b7cc5
authored
2 years ago
by
Ingrid Martinsheimen Egge
Browse files
Options
Downloads
Patches
Plain Diff
flere tester
parent
3ee31938
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
Merge profilinnstillinger into main
Pipeline
#225231
failed
2 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/EditProfile.vue
+0
-3
0 additions, 3 deletions
src/components/EditProfile.vue
src/components/__tests__/EditProfile.spec.js
+33
-1
33 additions, 1 deletion
src/components/__tests__/EditProfile.spec.js
with
33 additions
and
4 deletions
src/components/EditProfile.vue
+
0
−
3
View file @
f91b7cc5
...
...
@@ -124,13 +124,10 @@ export default {
}).
catch
(
error
=>
{
console
.
log
(
error
)
if
(
error
.
message
===
'
400
'
)
{
if
(
newRestricted
){
this
.
alertMsg
=
'
‼️Det oppsto en feil: Sørg for at det finnes mist en standard profil på kontoen‼️
'
}
else
if
(
this
.
updatedProfile
.
name
!==
this
.
initialName
||
this
.
updatedProfile
.
name
)
{
this
.
alertMsg
=
'
‼️Det oppsto en feil: Det finnes allerede en bruker med samme navn‼️
'
}
}
else
{
this
.
alertMsg
=
"
‼️Det oppsto en feil.‼️
"
...
...
This diff is collapsed.
Click to expand it.
src/components/__tests__/EditProfile.spec.js
+
33
−
1
View file @
f91b7cc5
...
...
@@ -20,7 +20,7 @@ describe('EditProfile', () => {
const
store
=
useAuthStore
(
pinia
)
store
.
profile
=
{
name
:
"
Ola
"
,
restricted
:
fals
e
,
restricted
:
tru
e
,
profileImageUrl
:
"
some/valid/image.png
"
}
...
...
@@ -29,4 +29,36 @@ describe('EditProfile', () => {
const
unameInput
=
wrapper
.
find
(
'
#brukernavn
'
);
expect
(
unameInput
.
element
.
value
).
to
.
contain
(
'
Ola
'
);
})
it
(
'
If profile.restricted is true, then radio input with value false is not selected
'
,
()
=>
{
const
radioInput
=
wrapper
.
find
(
'
input[type=radio][value="false"]
'
)
expect
(
radioInput
.
element
.
checked
).
toBe
(
false
)
})
it
(
'
If profile.restricted is true, then radio input with valuetrue *is* selected
'
,
()
=>
{
const
radioInput
=
wrapper
.
find
(
'
input[type=radio][value="true"]
'
)
expect
(
radioInput
.
element
.
checked
).
toBe
(
true
)
})
//update the value from restricted true -> false
it
(
'
After changing restricted radio, the values are updated too
'
,
async
()
=>
{
const
notRestrictedRadioInput
=
wrapper
.
find
(
'
#normal
'
)
const
restrictedRadioInput
=
wrapper
.
find
(
'
#restricted
'
)
expect
(
notRestrictedRadioInput
.
element
.
checked
).
toBe
(
false
)
expect
(
restrictedRadioInput
.
element
.
checked
).
toBe
(
true
)
await
notRestrictedRadioInput
.
trigger
(
'
click
'
)
expect
(
notRestrictedRadioInput
.
element
.
checked
).
toBe
(
true
)
expect
(
restrictedRadioInput
.
element
.
checked
).
toBe
(
false
)
await
wrapper
.
vm
.
$nextTick
()
setTimeout
(()
=>
{
expect
(
wrapper
.
vm
.
updatedProfile
.
upRestricted
).
toBe
(
false
)
},
1000
);
})
})
\ No newline at end of file
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