webcomponent: Updated unit tests
This commit is contained in:
parent
1bdd968f79
commit
e08e30ee0b
@ -59,7 +59,7 @@ describe('Web Component Attributes', () => {
|
|||||||
(component as any).updateIframeSrc();
|
(component as any).updateIframeSrc();
|
||||||
|
|
||||||
// Check if origin was extracted and set
|
// Check if origin was extracted and set
|
||||||
expect((component as any).allowedOrigin).toBe('https://example.com');
|
expect((component as any).targetIframeOrigin).toBe('https://example.com');
|
||||||
expect((component as any).commandsManager.allowedOrigin).toBe('https://example.com');
|
expect((component as any).commandsManager.targetIframeOrigin).toBe('https://example.com');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -24,11 +24,11 @@ describe('OpenViduMeet Web Component Commands', () => {
|
|||||||
const testOrigin = 'https://test-origin.com';
|
const testOrigin = 'https://test-origin.com';
|
||||||
|
|
||||||
|
|
||||||
commandsManager.setAllowedOrigin(testOrigin);
|
commandsManager.setTargetOrigin(testOrigin);
|
||||||
expect(commandsManager['allowedOrigin']).toBe(testOrigin);
|
expect(commandsManager['targetIframeOrigin']).toBe(testOrigin);
|
||||||
|
|
||||||
// Check if it was updated
|
// Check if it was updated
|
||||||
expect((component as any).commandsManager.allowedOrigin).toBe(testOrigin);
|
expect((component as any).commandsManager.targetIframeOrigin).toBe(testOrigin);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call commandsManager.leaveRoom when leaveRoom is called', () => {
|
it('should call commandsManager.leaveRoom when leaveRoom is called', () => {
|
||||||
@ -60,7 +60,7 @@ describe('OpenViduMeet Web Component Commands', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Set allowed origin
|
// Set allowed origin
|
||||||
(component as any).commandsManager.setAllowedOrigin('https://test.com');
|
(component as any).commandsManager.setTargetOrigin('https://test.com');
|
||||||
|
|
||||||
// Send a message
|
// Send a message
|
||||||
(component as any).commandsManager.sendMessage({ command: 'TEST' });
|
(component as any).commandsManager.sendMessage({ command: 'TEST' });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user