Commit 2007ebce authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Test toast messages forwarding logic

parent f6063e1f
......@@ -1126,4 +1126,32 @@ describe('FrameSyncService', () => {
assert.calledWith(guestRPC().call, 'showContentInfo', contentInfo);
});
});
context('when a toast message is pushed', () => {
it('forwards the message to the host if it is hidden and the sidebar is collapsed', () => {
const message = { visuallyHidden: true };
emitHostEvent('sidebarClosed');
fakeToastMessenger.emit('toastMessagePushed', message);
assert.calledWith(hostRPC().call, 'toastMessagePushed', message);
});
it('ignores the message if it is not hidden', () => {
const message = { visuallyHidden: false };
emitHostEvent('sidebarClosed');
fakeToastMessenger.emit('toastMessagePushed', message);
assert.neverCalledWith(hostRPC().call, 'toastMessagePushed', message);
});
it('ignores the message if the sidebar is not collapsed', () => {
const message = { visuallyHidden: true };
fakeToastMessenger.emit('toastMessagePushed', message);
assert.neverCalledWith(hostRPC().call, 'toastMessagePushed', message);
});
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment