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
58b29e9f
Commit
58b29e9f
authored
Oct 15, 2020
by
Graham Smith
Browse files
fix unit test
parent
84975413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tests/unit/api/services/user.spec.js
tests/unit/api/services/user.spec.js
+2
-1
No files found.
tests/unit/api/services/user.spec.js
View file @
58b29e9f
import
UserApi
from
"
@/api/services/user
"
;
import
UserApi
from
"
@/api/services/user
"
;
import
{
HTTP
}
from
"
@/api/http-common
"
;
import
{
HTTP
}
from
"
@/api/http-common
"
;
import
{
HTTP
as
MOCK_HTTP
}
from
"
@/api/mock-http-common
"
;
const
user1
=
{
name
:
"
mock user1
"
,
email
:
"
user1@mock.com
"
,
phone
:
"
111
"
};
const
user1
=
{
name
:
"
mock user1
"
,
email
:
"
user1@mock.com
"
,
phone
:
"
111
"
};
const
user2
=
{
name
:
"
mock user2
"
,
email
:
"
user2@mock.com
"
,
phone
:
"
222
"
};
const
user2
=
{
name
:
"
mock user2
"
,
email
:
"
user2@mock.com
"
,
phone
:
"
222
"
};
...
@@ -29,7 +30,7 @@ describe("user api", () => {
...
@@ -29,7 +30,7 @@ describe("user api", () => {
});
});
it
(
"
should search
"
,
async
()
=>
{
it
(
"
should search
"
,
async
()
=>
{
HTTP
.
get
=
jest
.
fn
().
mockResolvedValue
(
mockUsersResponse
);
MOCK_
HTTP
.
get
=
jest
.
fn
().
mockResolvedValue
(
mockUsersResponse
);
let
response
=
await
UserApi
.
search
();
let
response
=
await
UserApi
.
search
();
expect
(
response
).
toEqual
([
user1
,
user2
]);
expect
(
response
).
toEqual
([
user1
,
user2
]);
...
...
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