Skip to content

Commit

Permalink
implement comments
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentUllal committed Aug 23, 2024
1 parent 922b83a commit e438485
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
18 changes: 3 additions & 15 deletions container/cypress/e2e/test-app/iframe/iframe-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,16 @@ describe('Iframe Container Test', () => {
});

it('sendCustomMessage', () => {
cy.get('#btn-1')
.click()
cy.get(containerSelector)
.shadow()
.get('iframe')
.then(iframe => {
const $body = iframe.contents().find('body')
cy.wrap($body)
.find('#content')
.should('have.text', ' ');
});

cy.get('#btn-1')
.click()
.then(() => {
cy.get(containerSelector)
.shadow()
.get('iframe')
.then(iframe => {
const $body = iframe.contents().find('body')
cy.wrap($body)
.find('#content')
.should('have.text', 'Received Custom Message: some data');
});
.should('have.text', 'Received Custom Message: some data');
});
});

Expand Down
13 changes: 4 additions & 9 deletions container/cypress/e2e/test-app/wc/wc-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,14 @@ describe('Web Container Test', () => {
});
});
it('sendCustomMessage', () => {
cy.get('#sendCustomMessageBtn')
.click()

cy.get(containerSelector)
.shadow()
.find('#customMessageDiv')
.should('have.text', 'Received Custom Message: ');
.should('have.text', 'Received Custom Message: cool custom Message');

cy.get('#sendCustomMessageBtn')
.click()
.then(() => {
cy.get(containerSelector)
.shadow()
.find('#customMessageDiv')
.should('have.text', 'Received Custom Message: cool custom Message');
});
});
});
});
9 changes: 4 additions & 5 deletions container/test-app/wc/clientAPI.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ <h3>
component based microfrontend
</h3>
<button id="luigi-update-context" type="button">Update context</button>
<button id="init-button" style="margin: 25px 0 15px">
container.init() to initialize defered container
</button>
<button id="sendCustomMessageBtn" style="margin: 25px 0 15px">sendCustomMessage</button>

<div style="height: fit-content;">
<div style="border: 1px solid blue">
<!-- Luigi Container to test general functionalities, params etc-->
<luigi-container
id="test-id"
data-test-id="luigi-client-api-test-01"
viewURL="./wc/helloWorldWC.js"
webcomponent="true"
Expand All @@ -38,6 +34,9 @@ <h3>
></luigi-container>
</div>

<button id="init-button" style="margin: 25px 0 15px">
container.init() to initialize defered container
</button>
<div style="border: 1px solid red">
<!-- Luigi Container to test defer-init flag-->

Expand Down Expand Up @@ -71,7 +70,7 @@ <h3>
deferInitContainer.init();
});
// document.querySelector('luigi-container');
const container = document.getElementById('test-id');
const container = document.querySelector('[data-test-id="luigi-client-api-test-01"]')
const sendCustomMsgBtn = document.getElementById('sendCustomMessageBtn');
sendCustomMsgBtn.addEventListener('click', () => {
container.sendCustomMessage('custom-message-id', {dataToSend: 'cool custom Message'});
Expand Down

0 comments on commit e438485

Please sign in to comment.