webcomponent: Updated unit tests

This commit is contained in:
Carlos Santos 2025-05-22 14:15:39 +02:00
parent 1bdd968f79
commit e08e30ee0b
2 changed files with 6 additions and 6 deletions

View File

@ -59,7 +59,7 @@ describe('Web Component Attributes', () => {
(component as any).updateIframeSrc();
// Check if origin was extracted and set
expect((component as any).allowedOrigin).toBe('https://example.com');
expect((component as any).commandsManager.allowedOrigin).toBe('https://example.com');
expect((component as any).targetIframeOrigin).toBe('https://example.com');
expect((component as any).commandsManager.targetIframeOrigin).toBe('https://example.com');
});
});

View File

@ -24,11 +24,11 @@ describe('OpenViduMeet Web Component Commands', () => {
const testOrigin = 'https://test-origin.com';
commandsManager.setAllowedOrigin(testOrigin);
expect(commandsManager['allowedOrigin']).toBe(testOrigin);
commandsManager.setTargetOrigin(testOrigin);
expect(commandsManager['targetIframeOrigin']).toBe(testOrigin);
// 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', () => {
@ -60,7 +60,7 @@ describe('OpenViduMeet Web Component Commands', () => {
});
// Set allowed origin
(component as any).commandsManager.setAllowedOrigin('https://test.com');
(component as any).commandsManager.setTargetOrigin('https://test.com');
// Send a message
(component as any).commandsManager.sendMessage({ command: 'TEST' });