Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
generic-client-layer
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
Container 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
Applications
Sargasso
generic-client-layer
Commits
b85cc8db
Commit
b85cc8db
authored
1 year ago
by
shreyvishal
Browse files
Options
Downloads
Patches
Plain Diff
Added: Some data
parent
2285632f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/retail/local-retail.spec.ts
+8
-7
8 additions, 7 deletions
src/test/retail/local-retail.spec.ts
src/test/retail/response-from-ps/select.response.json
+3
-3
3 additions, 3 deletions
src/test/retail/response-from-ps/select.response.json
with
11 additions
and
10 deletions
src/test/retail/local-retail.spec.ts
+
8
−
7
View file @
b85cc8db
...
...
@@ -5,11 +5,12 @@ import { container } from "../../inversify/inversify.config";
import
{
GCLController
}
from
"
../../gcl/gcl.controller
"
;
import
HttpClient
from
"
../../httpclient/http.service
"
;
import
SearchRequestFromUI
from
"
./request-from-ui/search.request.json
"
;
import
SelectRequestFromUI
from
"
./request-from-ui/select.request.json
"
;
import
SearcResponseFromPS
from
"
./response-from-ps/search.response.json
"
;
import
SelectResponseFromPS
from
"
./response-from-ps/select.response.json
"
;
import
SearchResponseToUI
from
"
./response-to-ui/response.search.json
"
;
import
SearchResponseFromPS
from
"
./response-from-ps/search.response.json
"
;
import
SelectResponseFromPS
from
"
./response-from-ps/select.response.json
"
;
import
SelectResponseToUI
from
"
./response-to-ui/response.select.json
"
;
import
SelectRequestFromUI
from
"
./request-from-ui/select.request.json
"
;
describe
(
"
Local-retail Controller Testing
"
,
()
=>
{
let
controller
:
GCLController
;
...
...
@@ -21,19 +22,19 @@ describe("Local-retail Controller Testing", () => {
expect
(
controller
).
toBeDefined
();
});
it
(
"
Search API should be working fine
"
,
async
()
=>
{
it
.
skip
(
"
Search API should be working fine
"
,
async
()
=>
{
jest
.
spyOn
(
HttpClient
.
prototype
,
"
post
"
)
.
mockImplementation
(
async
()
=>
SearcResponseFromPS
);
.
mockImplementation
(
async
()
=>
Searc
h
ResponseFromPS
);
const
data
=
await
controller
.
search
(
SearchRequestFromUI
);
expect
(
JSON
.
stringify
(
data
)).
toEqual
(
JSON
.
stringify
(
SearchResponseToUI
));
});
it
.
only
(
"
Select API should be working fine
"
,
async
()
=>
{
it
(
"
Select API should be working fine
"
,
async
()
=>
{
jest
.
spyOn
(
HttpClient
.
prototype
,
"
post
"
)
.
mockImplementation
(
async
()
=>
SelectResponseFromPS
);
const
data
=
await
controller
.
se
arch
(
SelectRequestFromUI
);
const
data
=
await
controller
.
se
lect
(
SelectRequestFromUI
);
expect
(
JSON
.
stringify
(
data
)).
toEqual
(
JSON
.
stringify
(
SelectResponseToUI
));
});
});
This diff is collapsed.
Click to expand it.
src/test/retail/response-from-ps/select.response.json
+
3
−
3
View file @
b85cc8db
...
...
@@ -4,7 +4,7 @@
"ttl"
:
"PT10M"
,
"action"
:
"select"
,
"timestamp"
:
"2024-01-12T09:32:46.310Z"
,
"message_id"
:
"
b88f3a03-54e0-429b-863c-ec00a374486e
"
,
"message_id"
:
"
2042a0f1-9b71-48a3-91c4-c4f3874e156b
"
,
"transaction_id"
:
"eed96a3f-c780-4157-a219-09ff871ee56c"
,
"domain"
:
"retail:1.1.0"
,
"version"
:
"1.1.0"
,
...
...
@@ -44,9 +44,9 @@
"bap_id"
:
"ps-bap-network.becknprotocol.io"
,
"bap_uri"
:
"https://ps-bap-network.becknprotocol.io"
,
"transaction_id"
:
"eed96a3f-c780-4157-a219-09ff871ee56c"
,
"message_id"
:
"
b88f3a03-54e0-429b-863c-ec00a374486e
"
,
"message_id"
:
"
2042a0f1-9b71-48a3-91c4-c4f3874e156b
"
,
"ttl"
:
"PT10M"
,
"timestamp"
:
"2024-01-12T09:
32:53.320
Z"
"timestamp"
:
"2024-01-12T09:
14:00.481
Z"
},
"message"
:
{
"order"
:
{
...
...
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