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
edba2098
Commit
edba2098
authored
May 05, 2021
by
hunter.congress
Browse files
adjusted positioning and font
parent
bdc5cc6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
66 deletions
+3
-66
tests/unit/components/Training/TrainingAttendance.spec.js
tests/unit/components/Training/TrainingAttendance.spec.js
+3
-66
No files found.
tests/unit/components/Training/TrainingAttendance.spec.js
View file @
edba2098
...
@@ -455,6 +455,7 @@ describe("TrainingAttendance", () => {
...
@@ -455,6 +455,7 @@ describe("TrainingAttendance", () => {
});
});
expect
(
wrapper
.
vm
.
$store
.
commit
).
toHaveBeenCalledTimes
(
1
);
expect
(
wrapper
.
vm
.
$store
.
commit
).
toHaveBeenCalledTimes
(
1
);
});
});
it
(
"
should call fetchDebounced when options change
"
,
async
()
=>
{
it
(
"
should call fetchDebounced when options change
"
,
async
()
=>
{
TrainingService
.
getCourseRegistrationsById
=
jest
TrainingService
.
getCourseRegistrationsById
=
jest
.
fn
()
.
fn
()
...
@@ -483,72 +484,6 @@ describe("TrainingAttendance", () => {
...
@@ -483,72 +484,6 @@ describe("TrainingAttendance", () => {
wrapper
.
vm
.
fetchDebounced
=
jest
.
fn
();
wrapper
.
vm
.
fetchDebounced
=
jest
.
fn
();
// trigger the watch for wrapper.vm.options
// trigger the watch for wrapper.vm.options
const
mockOptions
=
{
itemsPerPage
:
46
};
wrapper
.
vm
.
options
=
mockOptions
;
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
vm
.
fetchDebounced
).
toHaveBeenCalledTimes
(
1
);
expect
(
wrapper
.
vm
.
params
.
pageSize
).
toEqual
(
mockOptions
.
itemsPerPage
);
});
it
(
"
should not call fetchDebounced if options don't change
"
,
async
()
=>
{
TrainingService
.
getCourseRegistrationsById
=
jest
.
fn
()
.
mockResolvedValue
({
registrations
:
[]
});
const
wrapper
=
shallowMount
(
TrainingAttendance
,
{
mocks
:
{
$store
:
{
state
:
{
error
:
{},
},
commit
:
jest
.
fn
(),
},
},
propsData
,
localVue
,
vuetify
,
});
await
flushPromises
();
wrapper
.
vm
.
fetchDebounced
=
jest
.
fn
();
// trigger the watch for wrapper.vm.options
wrapper
.
vm
.
options
=
{
...
wrapper
.
vm
.
options
};
await
wrapper
.
vm
.
$nextTick
();
// since the old and new options are equal, fetchDebounced should not hae been called
expect
(
wrapper
.
vm
.
fetchDebounced
).
toHaveBeenCalledTimes
(
0
);
});
it
(
"
should call fetchDebounced when reload changes
"
,
async
()
=>
{
TrainingService
.
getCourseRegistrationsById
=
jest
.
fn
()
.
mockResolvedValue
({
registrations
:
[]
});
const
wrapper
=
shallowMount
(
TrainingAttendance
,
{
mocks
:
{
$store
:
{
state
:
{
error
:
{},
},
commit
:
jest
.
fn
(),
},
},
data
()
{
return
{
selectedUsers
:
[{
userId
:
1
},
{
userId
:
2
}],
listItems
:
[{
userId
:
1
},
{
userId
:
2
},
{
userId
:
3
}],
};
},
propsData
:
{
...
propsData
,
reload
:
0
},
localVue
,
vuetify
,
});
await
flushPromises
();
wrapper
.
vm
.
fetchDebounced
=
jest
.
fn
();
const
mockOptions
=
2
;
wrapper
.
vm
.
reload
=
mockOptions
;
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
setProps
({
reload
:
1
});
await
wrapper
.
setProps
({
reload
:
1
});
expect
(
wrapper
.
vm
.
fetchDebounced
).
toHaveBeenCalledTimes
(
1
);
expect
(
wrapper
.
vm
.
fetchDebounced
).
toHaveBeenCalledTimes
(
1
);
});
});
...
@@ -678,3 +613,5 @@ describe("TrainingAttendance", () => {
...
@@ -678,3 +613,5 @@ describe("TrainingAttendance", () => {
});
});
});
});
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