UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Platform One
P
Party Bus
Launchboard
launchboard-fe
Commits
dcd3fee4
Commit
dcd3fee4
authored
Feb 24, 2021
by
graham.smith
Browse files
fix ProjectsSummary
parent
aecc5949
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
tests/unit/components/ProjectsSummary.spec.js
tests/unit/components/ProjectsSummary.spec.js
+9
-6
No files found.
tests/unit/components/ProjectsSummary.spec.js
View file @
dcd3fee4
...
@@ -10,10 +10,12 @@ localVue.use(Vuex);
...
@@ -10,10 +10,12 @@ localVue.use(Vuex);
describe
(
"
ProjectsSummary
"
,
()
=>
{
describe
(
"
ProjectsSummary
"
,
()
=>
{
afterEach
(()
=>
{
afterEach
(()
=>
{
jest
.
clear
AllMocks
();
jest
.
reset
AllMocks
();
});
});
it
(
"
should load component
"
,
async
()
=>
{
it
(
"
should load component
"
,
()
=>
{
ProjectService
.
getProjectsSummary
=
jest
.
fn
();
// render the component
// render the component
const
wrapper
=
shallowMount
(
ProjectsSummary
,
{
const
wrapper
=
shallowMount
(
ProjectsSummary
,
{
mocks
:
{
mocks
:
{
...
@@ -32,7 +34,8 @@ describe("ProjectsSummary", () => {
...
@@ -32,7 +34,8 @@ describe("ProjectsSummary", () => {
expect
(
wrapper
.
find
(
"
.error
"
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
"
.error
"
).
exists
()).
toBe
(
false
);
});
});
it
(
"
should filter by favorited projects
"
,
async
()
=>
{
it
(
"
should filter by favorited projects
"
,
()
=>
{
ProjectService
.
getProjectsSummary
=
jest
.
fn
();
// render the component
// render the component
const
wrapper
=
shallowMount
(
ProjectsSummary
,
{
const
wrapper
=
shallowMount
(
ProjectsSummary
,
{
mocks
:
{
mocks
:
{
...
@@ -64,7 +67,7 @@ describe("ProjectsSummary", () => {
...
@@ -64,7 +67,7 @@ describe("ProjectsSummary", () => {
]);
]);
});
});
it
(
"
should refresh projects
"
,
async
()
=>
{
it
(
"
should refresh projects
"
,
()
=>
{
ProjectService
.
getProjectsSummary
=
jest
.
fn
().
mockResolvedValue
([
ProjectService
.
getProjectsSummary
=
jest
.
fn
().
mockResolvedValue
([
{
id
:
"
1
"
,
links
:
{},
latestPipeline
:
{},
favorite
:
false
},
{
id
:
"
1
"
,
links
:
{},
latestPipeline
:
{},
favorite
:
false
},
{
id
:
"
2
"
,
links
:
{},
latestPipeline
:
{},
favorite
:
true
},
{
id
:
"
2
"
,
links
:
{},
latestPipeline
:
{},
favorite
:
true
},
...
@@ -99,7 +102,7 @@ describe("ProjectsSummary", () => {
...
@@ -99,7 +102,7 @@ describe("ProjectsSummary", () => {
expect
(
wrapper
.
vm
.
filteredProjects
).
toEqual
([]);
expect
(
wrapper
.
vm
.
filteredProjects
).
toEqual
([]);
});
});
it
(
"
should refresh with empty projects and trigger empty string
"
,
async
()
=>
{
it
(
"
should refresh with empty projects and trigger empty string
"
,
()
=>
{
ProjectService
.
getProjectsSummary
=
jest
.
fn
().
mockResolvedValue
([]);
ProjectService
.
getProjectsSummary
=
jest
.
fn
().
mockResolvedValue
([]);
// render the component
// render the component
const
wrapper
=
shallowMount
(
ProjectsSummary
,
{
const
wrapper
=
shallowMount
(
ProjectsSummary
,
{
...
@@ -130,7 +133,7 @@ describe("ProjectsSummary", () => {
...
@@ -130,7 +133,7 @@ describe("ProjectsSummary", () => {
expect
(
wrapper
.
vm
.
filteredProjects
).
toEqual
([]);
expect
(
wrapper
.
vm
.
filteredProjects
).
toEqual
([]);
});
});
it
(
"
should refresh with error
"
,
async
()
=>
{
it
(
"
should refresh with error
"
,
()
=>
{
ProjectService
.
getProjectsSummary
=
jest
.
fn
();
ProjectService
.
getProjectsSummary
=
jest
.
fn
();
// render the component
// render the component
const
wrapper
=
shallowMount
(
ProjectsSummary
,
{
const
wrapper
=
shallowMount
(
ProjectsSummary
,
{
...
...
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