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 0514c1b72d..1cd7582460 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 @@ -8,7 +8,7 @@ describe('Compound Container Tests', () => { stub = cy.stub(); }); - it('LuigiClient API getUserSettings for LuigiCompoundContainer', () => { + it('LuigiClient API - getUserSettings', () => { cy.on('window:alert', stub); cy.get(containerSelector) @@ -20,7 +20,7 @@ describe('Compound Container Tests', () => { }); }); - it('LuigiClient API getAnchor for LuigiCompoundContainer', () => { + it('LuigiClient API - getAnchor', () => { cy.on('window:alert', stub); cy.get(containerSelector) @@ -32,6 +32,79 @@ describe('Compound Container Tests', () => { }); }); + it('LuigiClient API - getDirtyStatus', () => { + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .contains('getDirtyStatus') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith('LuigiClient.uxManager().getDirtyStatus()=false'); + }); + }); + + it('LuigiClient API - getClientPermissions', () => { + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .contains('getClientPermissions') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith('{"permission":"testPermission"}'); + }); + }); + + it('LuigiClient API - getNodeParams', () => { + cy.on('window:alert', stub); + + // getNodeParams is not available for compound children, so default behavior should be to return empty {} + cy.get(containerSelector) + .shadow() + .contains('get node params') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith('LuigiClient.getNodeParams()={}'); + }); + }); + + it('LuigiClient API - getPathParams', () => { + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .contains('getPathParams') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith('{"path":"param"}'); + }); + }); + + it('LuigiClient API - setViewGroupData', () => { + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .contains('setViewGroupData') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith('{"vg":"some data"}'); + }); + }); + + it('LuigiClient API - getCoreSearchParams', () => { + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .contains('getCoreSearchParams') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith('{"test":"searchParam1"}'); + }); + }); + it('LuigiClient API updateContext', () => { cy.on('window:alert', stub); @@ -41,10 +114,12 @@ describe('Compound Container Tests', () => { .then(() => { cy.get(containerSelector) .shadow() - .contains('updateContext') + .contains('retrieveContextValue') .click() .then(() => { - expect(stub.getCall(0)).to.be.calledWith('compoundWC.ctx={"label":"Dashboard","title":"Some input","instant":true,"newContextData":"some data"}'); + expect(stub.getCall(0)).to.be.calledWith( + 'compoundWC.ctx={"label":"Dashboard","title":"Some input","instant":true,"newContextData":"some data"}' + ); }); }); }); diff --git a/container/test-app/compound/compoundClientAPI.html b/container/test-app/compound/compoundClientAPI.html index d93e956653..37a6a7495f 100644 --- a/container/test-app/compound/compoundClientAPI.html +++ b/container/test-app/compound/compoundClientAPI.html @@ -220,6 +220,7 @@

// setViewGroup Data listener compoundContainer.addEventListener(MFEventID.SET_VIEW_GROUP_DATA_REQUEST, event => { console.log('Set View Group Data Request received', event.detail, event); + alert(JSON.stringify(event.detail)); }); const deferInitContainer = document.getElementById('defer-init-test'); diff --git a/container/test-app/compound/helloWorldWC.js b/container/test-app/compound/helloWorldWC.js index d2bbfc239c..e4214bfb75 100644 --- a/container/test-app/compound/helloWorldWC.js +++ b/container/test-app/compound/helloWorldWC.js @@ -49,8 +49,8 @@ export default class extends HTMLElement { const getDirtyStatusBtn = document.createElement('template'); getDirtyStatusBtn.innerHTML = ''; - const updateContextBtn = document.createElement('template'); - updateContextBtn.innerHTML = ''; + const retrieveContextValueBtn = document.createElement('template'); + retrieveContextValueBtn.innerHTML = ''; const uxManagerMultipleRequestsBtn = document.createElement('template'); uxManagerMultipleRequestsBtn.innerHTML = `