Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vue-sample-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sanga Raju Gupta Bonagiri
vue-sample-test
Commits
f07889e7
Commit
f07889e7
authored
Dec 19, 2023
by
Sanga Raju Gupta Bonagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test case changes
parent
b05ae3b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
2 deletions
+53
-2
CategoriesList.spec.js
src/Views/CategoriesList/CategoriesList.spec.js
+51
-0
Contact.spec.js
src/Views/Contact/Contact.spec.js
+2
-2
No files found.
src/Views/CategoriesList/CategoriesList.spec.js
0 → 100644
View file @
f07889e7
import
{
shallowMount
}
from
"@vue/test-utils"
;
import
{
jest
}
from
'@jest/globals'
;
import
CategoriesList
from
"../CategoriesList/CategoriesList.vue"
;
const
product
=
{
id
:
1
,
title
:
"Fjallraven - Foldsack No. 1 Backpack, Fits 15 Laptops"
,
price
:
109.95
,
description
:
"Your perfect pack for everyday use and walks in the forest. Stash your laptop (up to 15 inches) in the padded sleeve, your everyday"
,
category
:
"men's clothing"
,
image
:
"https://fakestoreapi.com/img/81fPKd-2AYL._AC_SL1500_.jpg"
,
rating
:
{
rate
:
3.9
,
count
:
120
}
}
const
$store
=
{
state
:
{
products
:
[
product
]
},
commit
:
jest
.
fn
()
}
const
mockRoute
=
{
params
:
{
product
:
"men's clothing"
}
}
const
wrapper
=
shallowMount
(
CategoriesList
,
{
global
:
{
mocks
:
{
$store
,
$route
:
mockRoute
}
}
})
describe
(
"Catergory"
,
()
=>
{
it
(
"To check the component redendered or not"
,
()
=>
{
console
.
log
(
wrapper
.
html
(),
"fsd"
)
expect
(
wrapper
.
contains
(
'product-card-stub'
)).
toBe
(
true
);
expect
((
wrapper
.
find
(
'product-card-stub'
)).
attributes
(
'product'
)).
toBe
();
})
})
\ No newline at end of file
src/Views/Contact/Contact.spec.js
View file @
f07889e7
import
{
mount
}
from
"@vue/test-utils"
import
About
from
"../About/Abou
t.vue"
;
import
Contact
from
"../Contact/Contac
t.vue"
;
describe
(
"notification.vue"
,
()
=>
{
test
(
"sample"
,
()
=>
{
const
wrapper
=
mount
(
About
,
);
const
wrapper
=
mount
(
Contact
);
expect
(
wrapper
.
text
()).
toEqual
(
"Contact page Loaded"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment