]> juplo.de Git - demos/kafka/chat/commitdiff
refactor: Prepared for version V2 of `ChatroomService`
authorKai Moritz <kai@juplo.de>
Sat, 11 Oct 2025 22:24:31 +0000 (00:24 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 11 Oct 2025 22:24:39 +0000 (00:24 +0200)
pacts
src/app/chatroom/chatroom.service.pact.spec.ts

diff --git a/pacts b/pacts
index 6ec14b0e50ab269edd0d0f9a98a4a3b167bffed3..8c4e57bb0973a60deb4d16b4e3ff13ba8a45989e 160000 (submodule)
--- a/pacts
+++ b/pacts
@@ -1 +1 @@
-Subproject commit 6ec14b0e50ab269edd0d0f9a98a4a3b167bffed3
+Subproject commit 8c4e57bb0973a60deb4d16b4e3ff13ba8a45989e
index 34f64e1a3cdea7a2e781ff6db412e944e62b4f98..2d0b156623f0c58644569093f09117b04698bd7b 100644 (file)
@@ -25,72 +25,6 @@ describe('Pact between the ChatroomService and the backend', () => {
   };
 
 
-  it('GET /list -- chatrooms available', async () => {
-
-    await provider
-      .addInteraction()
-      .given('there are 10 shards')
-      .given('the server is responsible for shard 2')
-      .given('chatroom 5c73531c-6fc4-426c-adcb-afc5c140a0f7 exists in shard 2')
-      .uponReceiving('a request for /list')
-      .withRequest('GET', '/list', (builder) => {
-        builder.headers({
-          Accept: Matchers.like('application/json'),
-        });
-      })
-      .willRespondWith(200, (builder) => {
-        builder.headers({ 'Content-Type': 'application/json' });
-        builder.jsonBody(Matchers.eachLike(EXAMPLE_CHATROOM));
-      })
-      .executeTest(async (mockserver) => {
-        await TestBed.configureTestingModule({
-          providers: [
-            ChatroomService,
-            {provide: APP_PROPS, useValue: {backendUri: mockserver.url + '/'}},
-            provideHttpClient(),
-          ]
-        });
-
-        const service = TestBed.inject(ChatroomService);
-        const chatrooms = await lastValueFrom(service.getChatrooms());
-
-        expect(chatrooms).toContainEqual(EXAMPLE_CHATROOM);
-      });
-  });
-
-  it('GET /list -- no chatrooms available', async () => {
-
-    await provider
-      .addInteraction()
-      .given('there are 10 shards')
-      .given('the server is responsible for shard 2')
-      .given('there are no chatrooms available at all in shard 2')
-      .uponReceiving('a request for /list')
-      .withRequest('GET', '/list', (builder) => {
-        builder.headers({
-          Accept: Matchers.like('application/json'),
-        });
-      })
-      .willRespondWith(200, (builder) => {
-        builder.headers({ 'Content-Type': 'application/json' });
-        builder.jsonBody([]);
-      })
-      .executeTest(async (mockserver) => {
-        await TestBed.configureTestingModule({
-          providers: [
-            ChatroomService,
-            {provide: APP_PROPS, useValue: {backendUri: mockserver.url + '/'}},
-            provideHttpClient(),
-          ]
-        });
-
-        const service = TestBed.inject(ChatroomService);
-        const chatrooms = await lastValueFrom(service.getChatrooms());
-
-        expect(chatrooms).toHaveLength(0);
-      });
-  });
-
   it('GET /{CHATROOM-ID} -- existing chatroom, responsible shard', async () => {
 
     await provider