Skip to content

Commit

Permalink
C2-25477: OpenFin joinSessionContextGroup update (#2312)
Browse files Browse the repository at this point in the history
When calling the exposed `joinSessionContextGroup`, it fails. This is probably because we try to return an object containing functions.
  • Loading branch information
antoinerollindev authored Feb 26, 2025
1 parent c9007c2 commit 8231068
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions spec/openfinHandler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,17 @@ describe('Openfin', () => {

it('should join a session context group', async () => {
const connectSyncMock = await connectMock.Interop.connectSync();
const joinSessionContextGroupSpy = jest.spyOn(
connectSyncMock,
'joinSessionContextGroup',
);
const joinSessionContextGroupSpy = jest
.spyOn(connectSyncMock, 'joinSessionContextGroup')
.mockResolvedValue({
id: 'createdId',
});

await openfinHandler.connect();
await openfinHandler.joinSessionContextGroup('contextGroupId');
const id = await openfinHandler.joinSessionContextGroup('contextGroupId');

expect(joinSessionContextGroupSpy).toHaveBeenCalledTimes(1);
expect(id).toEqual('createdId');
});

it('should return all context groups', async () => {
Expand Down
4 changes: 3 additions & 1 deletion src/app/openfin-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ export class OpenfinHandler {
* Joins or create a context group that does not persist between runs and aren't present on snapshots.
*/
public async joinSessionContextGroup(contextGroupId: string) {
return this.interopClient?.joinSessionContextGroup(contextGroupId);
return this.interopClient
?.joinSessionContextGroup(contextGroupId)
.then(({ id }) => id);
}

/**
Expand Down

0 comments on commit 8231068

Please sign in to comment.