Skip to content

Commit 6c3d4bb

Browse files
committed
Extended integration tests
1 parent 39730b4 commit 6c3d4bb

File tree

5 files changed

+430
-106
lines changed

5 files changed

+430
-106
lines changed

src/guestStayAccounts/api/api.e2e.spec.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ApiE2ESpecification,
66
expectResponse,
77
getApplication,
8+
type TestRequest,
89
} from '@event-driven-io/emmett-expressjs';
910
import {
1011
EventStoreDBContainer,
@@ -26,6 +27,7 @@ describe('guestStayAccount E2E', () => {
2627
let roomId: string;
2728
// let guestStayAccountId: string;
2829
// const amount = Math.random() * 100;
30+
const transactionId = randomUUID();
2931

3032
let esdbContainer: StartedEventStoreDBContainer;
3133
let given: ApiE2ESpecification;
@@ -38,7 +40,12 @@ describe('guestStayAccount E2E', () => {
3840
(eventStore: EventStore) =>
3941
getApplication({
4042
apis: [
41-
guestStayAccountsApi(eventStore, doesGuestStayExist, () => now),
43+
guestStayAccountsApi(
44+
eventStore,
45+
doesGuestStayExist,
46+
(prefix) => `${prefix}-${transactionId}`,
47+
() => now,
48+
),
4249
],
4350
}),
4451
);
@@ -55,8 +62,10 @@ describe('guestStayAccount E2E', () => {
5562
});
5663

5764
describe('When empty', () => {
65+
const notExistingAccount: TestRequest[] = [];
66+
5867
it('should add product item', () => {
59-
return given()
68+
return given(...notExistingAccount)
6069
.when((request) => request.post(`/guests/${guestId}/stays/${roomId}`))
6170
.then([expectResponse(201)]);
6271
});

0 commit comments

Comments
 (0)