Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt2106_2024_03_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
Scrum_Team_3
idatt2106_2024_03_frontend
Commits
2ec44bec
Commit
2ec44bec
authored
1 year ago
by
Sverre Frogner Haugen
Browse files
Options
Downloads
Patches
Plain Diff
Wrote unit test for InfoComponent
parent
8d6a6024
No related branches found
No related tags found
1 merge request
!44
General components testing
Pipeline
#279194
passed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/__tests__/InfoComponent.spec.ts
+17
-0
17 additions, 0 deletions
src/components/__tests__/InfoComponent.spec.ts
with
17 additions
and
0 deletions
src/components/__tests__/InfoComponent.spec.ts
0 → 100644
+
17
−
0
View file @
2ec44bec
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
InfoComponent
from
'
@/components/InfoComponent.vue
'
import
{
describe
,
it
,
expect
}
from
'
vitest
'
//Needs to be updated when the info component gets dynamic data instead of static data
describe
(
'
InfoComponent
'
,
()
=>
{
it
(
'
renders the correct quote and total savings
'
,
()
=>
{
const
wrapper
=
shallowMount
(
InfoComponent
);
const
quote
=
wrapper
.
find
(
'
#Quote
'
);
const
totalSavings
=
wrapper
.
find
(
'
#TotalSavings
'
);
expect
(
quote
.
text
()).
toBe
(
'
Sparetips: Sett av et jevnt beløp hver måned på sparekonto eller lignende.
'
);
expect
(
totalSavings
.
text
()).
toBe
(
'
Våre brukere har spart til sammen 5000 nok
'
);
});
});
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