Skip to content

Commit

Permalink
Fixes flaky e2e test in container (#4123)
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn authored Jan 24, 2025
1 parent 2ed0972 commit 98ab629
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
describe('Compound Container Tests', () => {
describe('LuigiClient API - LuigiCompoundContainer', () => {
const containerSelector = '[data-test-id="luigi-client-api-test-compound-01"]';
let consoleLog;
let consoleInfo;
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', (value) => {
consoleLog = value;
// Clear logs in window console
if (Object.prototype.toString.call(win.console.clear) === '[object Function]') {
win.console.clear();
}

// Set up a spy on console.info
cy.stub(win.console, 'info', (value) => {
consoleInfo = value;
});
}
});
Expand Down Expand Up @@ -290,7 +295,7 @@ describe('Compound Container Tests', () => {

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');
expect(consoleInfo).to.equal('dataConverter(): Received Custom Message from "input1" MF My own event data');
});
});

Expand Down
2 changes: 1 addition & 1 deletion container/test-app/compound/compoundClientAPI.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h3>
name: 'sendInput',
action: 'update',
dataConverter: (data) => {
console.log(
console.info(
'dataConverter(): Received Custom Message from "input1" MF ' + data,
);
return 'new text: ' + data;
Expand Down

0 comments on commit 98ab629

Please sign in to comment.