mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-4657: Patch for OpenFin (#2271)
This commit is contained in:
@@ -13,9 +13,10 @@ jest.mock('@openfin/node-adapter', () => ({
|
||||
registerIntentHandler: jest.fn(),
|
||||
getAllClientsInContextGroup: jest.fn(),
|
||||
joinContextGroup: jest.fn(),
|
||||
joinSessionContextGroup: jest.fn(),
|
||||
getContextGroups: jest.fn(),
|
||||
fireIntentForContext: jest.fn(),
|
||||
removeClientFromContextGroup: jest.fn(),
|
||||
removeFromContextGroup: jest.fn(),
|
||||
}),
|
||||
},
|
||||
});
|
||||
@@ -185,6 +186,19 @@ describe('Openfin', () => {
|
||||
expect(joinContextGroupSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('should join a session context group', async () => {
|
||||
const connectSyncMock = await connectMock.Interop.connectSync();
|
||||
const joinSessionContextGroupSpy = jest.spyOn(
|
||||
connectSyncMock,
|
||||
'joinSessionContextGroup',
|
||||
);
|
||||
|
||||
await openfinHandler.connect();
|
||||
await openfinHandler.joinSessionContextGroup('contextGroupId');
|
||||
|
||||
expect(joinSessionContextGroupSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('should return all context groups', async () => {
|
||||
const connectSyncMock = await connectMock.Interop.connectSync();
|
||||
const getContextGroupsSpy = jest.spyOn(connectSyncMock, 'getContextGroups');
|
||||
@@ -210,7 +224,10 @@ describe('Openfin', () => {
|
||||
|
||||
it('should fire an intent for a given context', async () => {
|
||||
const connectSyncMock = await connectMock.Interop.connectSync();
|
||||
const fireIntentSpy = jest.spyOn(connectSyncMock, 'fireIntentForContext');
|
||||
const fireIntentForContextSpy = jest.spyOn(
|
||||
connectSyncMock,
|
||||
'fireIntentForContext',
|
||||
);
|
||||
|
||||
await openfinHandler.connect();
|
||||
const context = {
|
||||
@@ -222,18 +239,18 @@ describe('Openfin', () => {
|
||||
};
|
||||
await openfinHandler.fireIntentForContext(context);
|
||||
|
||||
expect(fireIntentSpy).toHaveBeenCalledTimes(1);
|
||||
expect(fireIntentForContextSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('should remove client from context group', async () => {
|
||||
it('should remove from context group', async () => {
|
||||
const connectSyncMock = await connectMock.Interop.connectSync();
|
||||
const fireIntentSpy = jest.spyOn(
|
||||
const removeFromContextGroupSpy = jest.spyOn(
|
||||
connectSyncMock,
|
||||
'removeClientFromContextGroup',
|
||||
'removeFromContextGroup',
|
||||
);
|
||||
|
||||
await openfinHandler.removeClientFromContextGroup();
|
||||
await openfinHandler.removeFromContextGroup();
|
||||
|
||||
expect(fireIntentSpy).toHaveBeenCalledTimes(1);
|
||||
expect(removeFromContextGroupSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user