Skip to content

Commit

Permalink
Adds Prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn committed Nov 25, 2024
1 parent 1086dc3 commit 2256ab4
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 43 deletions.
26 changes: 11 additions & 15 deletions client-frameworks-support/testing-utilities/test/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>Luigi Mock Engine Testing MFE</title>
Expand All @@ -18,9 +18,7 @@
<div class="fd-layout-panel">
<div class="fd-layout-panel__header">
<div class="fd-layout-panel__head">
<h3 class="fd-title fd-title--h3">
UX Manager testing panel
</h3>
<h3 class="fd-title fd-title--h3">UX Manager testing panel</h3>
<div class="fd-layout-panel__actions">
<button id="uxbutton1" class="fd-button" data-arg1="alert">
Test MockModule Alert
Expand All @@ -42,9 +40,7 @@ <h3 class="fd-title fd-title--h3">
<div class="fd-layout-panel">
<div class="fd-layout-panel__header">
<div class="fd-layout-panel__head">
<h3 class="fd-title fd-title--h3">
Link Manager testing panel
</h3>
<h3 class="fd-title fd-title--h3">Link Manager testing panel</h3>
<div class="fd-layout-panel__actions">
<button id="button1" class="fd-button" data-arg1="modal">
Test MockModule Modal
Expand Down Expand Up @@ -76,7 +72,7 @@ <h3 class="fd-title fd-title--h3">
'uxbutton1',
'uxbutton2',
'uxbutton3',
'uxbutton4'
'uxbutton4',
];

// Attach post message hook from MockModule
Expand All @@ -91,23 +87,23 @@ <h3 class="fd-title fd-title--h3">
case 'modal':
LuigiClient.linkManager().openAsModal('projects/pr1/users', {
title: 'Users',
size: 'm'
size: 'm',
});
break;

case 'split':
LuigiClient.linkManager().openAsSplitView('projects/pr1/logs', {
title: 'Logs',
size: 40,
collapsed: true
collapsed: true,
});
break;

case 'drawer':
LuigiClient.linkManager().openAsDrawer('projects/pr1/drawer', {
header: true,
backdrop: true,
size: 's'
size: 's',
});
break;

Expand All @@ -119,7 +115,7 @@ <h3 class="fd-title fd-title--h3">
case 'alert':
const settings = {
text: 'This is just a test alert for external micro frontend.',
type: 'success'
type: 'success',
};
LuigiClient.uxManager().showAlert(settings);
break;
Expand All @@ -130,12 +126,12 @@ <h3 class="fd-title fd-title--h3">
header: 'Confirmation',
body: 'Are you sure you want to do this?',
buttonConfirm: 'Yes',
buttonDismiss: 'No'
buttonDismiss: 'No',
};
LuigiClient.uxManager()
.showConfirmationModal(modalSettings)
.then(() => {})
.catch(e => {});
.catch((e) => {});
break;

case 'loadIndicator':
Expand All @@ -152,7 +148,7 @@ <h3 class="fd-title fd-title--h3">
};

// Attach event listeners to Buttons
buttonArray.forEach(btn => {
buttonArray.forEach((btn) => {
document.getElementById(btn).addEventListener('click', callMockModule);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('Compound Container Tests', () => {
const alertMessages = [
'UPDATE_TOP_NAVIGATION_REQUEST event received',
'some goBackValue',
'LuigiClient.linkManager().pathExists()=true\nthis.LuigiClient.linkManager().hasBack()=false',
'LuigiClient.linkManager().pathExists()=true\nthis.LuigiClient.linkManager().hasBack()=false'
];

cy.get(containerSelector)
Expand All @@ -192,7 +192,7 @@ describe('Compound Container Tests', () => {
.get('#showAlert')
.click()
.then(() => {
expect(stub.getCall(0)).to.be.calledWith("uxManager().showAlert() test");
expect(stub.getCall(0)).to.be.calledWith('uxManager().showAlert() test');
});
});

Expand Down
14 changes: 4 additions & 10 deletions container/cypress/e2e/test-app/iframe/iframe-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,13 @@ describe('Iframe Container Test', () => {
cy.get(containerSelector)
.shadow()
.get('iframe')
.then(iframe => {
.then((iframe) => {
const $body = iframe.contents().find('body');
cy.wrap($body)
.contains('test showAlert')
.click()
.then(() => {
cy.wrap(stub).should(
'have.been.calledWith',
'show-alert-request message received: {\"isTrusted\":true}'
);
cy.wrap(stub).should('have.been.calledWith', 'show-alert-request message received: {"isTrusted":true}');
});
});
});
Expand All @@ -60,17 +57,14 @@ describe('Iframe Container Test', () => {
cy.get(containerSelector)
.shadow()
.get('iframe')
.then(iframe => {
.then((iframe) => {
const $body = iframe.contents().find('body');
cy.wrap($body)
.contains('test goBack')
.click()
.then(() => {
console.log(cy.wrap(stub));
cy.wrap(stub).should(
'have.been.calledWith',
'navigate-back-request'
);
cy.wrap(stub).should('have.been.calledWith', 'navigate-back-request');
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions container/cypress/e2e/test-app/wc/wc-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ describe('Web Container Test', () => {
const alertMessages = [
'UPDATE_TOP_NAVIGATION_REQUEST event received',
'some goBackValue',
'LuigiClient.linkManager().pathExists()=true\nthis.LuigiClient.linkManager().hasBack()=false',
'LuigiClient.linkManager().pathExists()=true\nthis.LuigiClient.linkManager().hasBack()=false'
];

cy.get(containerSelector)
Expand All @@ -217,7 +217,7 @@ describe('Web Container Test', () => {
.get('#showAlert')
.click()
.then(() => {
expect(stub.getCall(0)).to.be.calledWith("uxManager().showAlert() test");
expect(stub.getCall(0)).to.be.calledWith('uxManager().showAlert() test');
});
});

Expand Down
11 changes: 7 additions & 4 deletions container/test-app/compound/compoundClientAPI.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,16 @@ <h3>
console.log(event.detail);
window.location.hash = event.detail.link;
});
compoundContainer.addEventListener(MFEventID.GO_BACK_REQUEST, event => {
compoundContainer.addEventListener(MFEventID.GO_BACK_REQUEST, (event) => {
console.log(event.detail);
alert(event.detail.goBackValue);
});
compoundContainer.addEventListener(MFEventID.UPDATE_TOP_NAVIGATION_REQUEST, event => {
alert("UPDATE_TOP_NAVIGATION_REQUEST event received");
});
compoundContainer.addEventListener(
MFEventID.UPDATE_TOP_NAVIGATION_REQUEST,
(event) => {
alert('UPDATE_TOP_NAVIGATION_REQUEST event received');
},
);
compoundContainer.addEventListener(MFEventID.ALERT_REQUEST, (event) => {
console.log(event.detail);
alert(event.detail.text);
Expand Down
4 changes: 2 additions & 2 deletions container/test-app/compound/helloWorldWC.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default class extends HTMLElement {
text: 'uxManager().showAlert() test',
type: 'info'
});
})
});

this.$publishEventBtn = this._shadowRoot.querySelector('#publishEvent');
this.$publishEventBtn.addEventListener('click', () => {
Expand Down Expand Up @@ -359,7 +359,7 @@ export default class extends HTMLElement {
type: 'info'
});
});
this.LuigiClient.linkManager().goBack({ goBackValue: 'some goBackValue' });
this.LuigiClient.linkManager().goBack({ goBackValue: 'some goBackValue' });
});

this.$setViewGroupData = this._shadowRoot.querySelector('#setViewGroupData');
Expand Down
2 changes: 1 addition & 1 deletion container/test-app/iframe/iframeContainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h3>
});

luigiContainer.addEventListener(Events.UPDATE_TOP_NAVIGATION_REQUEST, (event) => {
alert("UPDATE_TOP_NAVIGATION_REQUEST event received");
alert('UPDATE_TOP_NAVIGATION_REQUEST event received');
});

luigiContainer.addEventListener(Events.CUSTOM_MESSAGE, (event) => {
Expand Down
4 changes: 2 additions & 2 deletions container/test-app/iframe/microfrontend.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ <h1 id="title">Multi purpose demo page</h1>
});
}

function goBack(){
function goBack() {
LuigiClient.linkManager().goBack();
}

function updateTopNavigation(){
function updateTopNavigation() {
LuigiClient.LuigiClient.linkManager().updateTopNavigation();
}

Expand Down
13 changes: 8 additions & 5 deletions container/test-app/wc/clientAPI.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,16 @@ <h3>
console.log(event.detail);
alert(event.detail.text);
});
luigiContainer.addEventListener(MFEventID.GO_BACK_REQUEST, event => {
console.log(event.detail)
luigiContainer.addEventListener(MFEventID.GO_BACK_REQUEST, (event) => {
console.log(event.detail);
alert(event.detail.goBackValue);
});
luigiContainer.addEventListener(MFEventID.UPDATE_TOP_NAVIGATION_REQUEST, event => {
alert("UPDATE_TOP_NAVIGATION_REQUEST event received");
});
luigiContainer.addEventListener(
MFEventID.UPDATE_TOP_NAVIGATION_REQUEST,
(event) => {
alert('UPDATE_TOP_NAVIGATION_REQUEST event received');
},
);
luigiContainer.addEventListener(
MFEventID.SHOW_CONFIRMATION_MODAL_REQUEST,
(event) => {
Expand Down

0 comments on commit 2256ab4

Please sign in to comment.