From 0094d249b7d6a429363366c5ee80bc70694b22ac Mon Sep 17 00:00:00 2001 From: Waldemar Mazurek Date: Mon, 23 Dec 2024 13:33:28 +0100 Subject: [PATCH] Test compatibility fix (#4092) --- .../compound/wc-compound-container.cy.js | 22 +++++++++---------- container/test-app/assets/panelHeader.js | 4 ---- .../test-app/compound/compoundClientAPI.html | 2 +- scripts/testCompatibility.sh | 16 +++++++------- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js b/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js index 0cc5b469cc..0422b11f71 100644 --- a/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js +++ b/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js @@ -1,13 +1,16 @@ describe('Compound Container Tests', () => { describe('LuigiClient API - LuigiCompoundContainer', () => { const containerSelector = '[data-test-id="luigi-client-api-test-compound-01"]'; + let consoleLog; let stub; beforeEach(() => { cy.visit('http://localhost:8080/compound/compoundClientAPI.html', { onBeforeLoad(win) { // Set up a spy on console.log - cy.stub(win.console, 'log').as('consoleLogSpy'); + cy.stub(win.console, 'log', (value) => { + consoleLog = value; + }); } }); stub = cy.stub(); @@ -283,17 +286,12 @@ describe('Compound Container Tests', () => { it('LuigiClient API publishEvent', () => { cy.on('window:alert', stub); - cy.get(containerSelector) - .shadow() - .contains('Publish event') - .click() - .then(() => { - expect(stub.getCall(0)).to.be.calledWith('sendInput'); - cy.get('@consoleLogSpy').should( - 'be.calledWith', - 'dataConverter(): Received Custom Message from "input1" MF My own event data' - ); - }); + cy.get(containerSelector).shadow().contains('Publish event').click(); + + cy.should(() => { + expect(stub.getCall(0)).to.be.calledWith('custom-message: sendInput'); + expect(consoleLog).to.equal('dataConverter(): Received Custom Message from "input1" MF My own event data'); + }); }); it('LuigiClient API uxManagerChainRequests', () => { diff --git a/container/test-app/assets/panelHeader.js b/container/test-app/assets/panelHeader.js index 27f2197444..d8d2a6e897 100644 --- a/container/test-app/assets/panelHeader.js +++ b/container/test-app/assets/panelHeader.js @@ -169,10 +169,6 @@ class panelHeader extends LuigiElement { }); } - afterInit(ctx) { - console.debug('after init', ctx); - } - render(ctx) { return html`