Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/mock-builders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

const connectUser = (client: StreamChat, user: Partial<UserResponse>) =>
new Promise<void>((resolve) => {
client['connectionId'] = 'dumm_connection_id';
// v10 keeps the connection id on `client.connectionIdManager`; requests that register a
// watch/presence subscription await it, so a mocked connect has to publish one or every
// `queryChannels()`/`channel.watch()` in the tests throws.
client.connectionIdManager.resolveConnectionId('dumm_connection_id');

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > does not call channel.watch for a given channel object with id and type if channel query already in progress

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > calls channel.watch for a given channel object with id and type if channel query not already in progress

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > does not call channel.watch for a given channel type and members array if channel query already in progress

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > calls channel.watch for a given channel type and members array if channel query not already in progress

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > does not call channel.watch for a given channel type and id if channel query already in progress

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > calls channel.watch for a given channel type and id if channel query not already in progress

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > throws an error if channel without with id but with channel members array are provided

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > throws an error if channel without with id and no channel members array are provided

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > throws an error if neither channel with id nor channel members array are provided

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20

Check failure on line 14 in src/mock-builders/index.ts

View workflow job for this annotation

GitHub Actions / Test

src/utils/__tests__/getChannel.test.ts > getChannel > throws an error if neither channel nor channel type are provided

TypeError: Cannot read properties of undefined (reading 'resolveConnectionId') ❯ src/mock-builders/index.ts:14:32 ❯ connectUser src/mock-builders/index.ts:10:3 ❯ getTestClientWithUser src/mock-builders/index.ts:56:9 ❯ src/utils/__tests__/getChannel.test.ts:24:20
client.user = { ...user, mutes: [] } as UserResponse;
client['_user'] = { ...user } as UserResponse;
// `userID` is a getter in v10 (derives from `client.user?.id`), so it can't be assigned;
Expand Down