Skip to content

Commit

Permalink
Improves e2e tests in Container (#4064)
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn authored Dec 19, 2024
1 parent 568c963 commit 5358527
Show file tree
Hide file tree
Showing 15 changed files with 12,976 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('create luigi-compound-container dynamically', () => {
const content = document.querySelector('.content');
const wc = document.createElement('luigi-compound-container');
wc.context = { title: 'Nested' }
wc.viewurl = 'https://luigiwebcomponents.gitlab.io/nested2.js';
wc.viewurl = 'http://localhost:8080/assets/nested2.js';
wc.compoundConfig = {
eventListeners: [
Expand All @@ -28,7 +28,7 @@ describe('create luigi-compound-container dynamically', () => {
}
],
children: [{
viewUrl: 'https://luigiwebcomponents.gitlab.io/layouts/panelHeader.js',
viewUrl: 'http://localhost:8080/assets/panelHeader.js',
context: {
title: 'My Awesome Grid',
description: 'Really awesome'
Expand All @@ -45,23 +45,23 @@ describe('create luigi-compound-container dynamically', () => {
}
}]
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/layouts/panelFooter.js',
viewUrl: 'http://localhost:8080/assets/panelFooter.js',
context: {
footer: 'This is the end of awesomeness'
},
layoutConfig: {
slot: "footer"
}
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/luigiwebcomponentmf/main.js',
viewUrl: 'http://localhost:8080/assets/main.js',
layoutConfig: {
slot: "content"
},
context: {
label: 'I am nested!'
}
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/luigi-wc-mfe/main.js',
viewUrl: 'http://localhost:8080/assets/mfeMain.js',
context: {
label: 'Update Joke',
showAlert: false
Expand All @@ -80,16 +80,12 @@ describe('create luigi-compound-container dynamically', () => {
.then(($container) => {
return cy
.wrap($container)
.find(
'luigi-wc-68747470733a2f2f6c75696769776562636f6d706f6e656e74732e6769746c61622e696f2f6e6573746564322e6a73'
)
.find('luigi-wc-687474703a2f2f6c6f63616c686f73743a383038302f6173736574732f6e6573746564322e6a73')
.shadow();
})
.then(($innerContainer) => {
cy.wrap($innerContainer)
.get(
'luigi-wc-68747470733a2f2f6c75696769776562636f6d706f6e656e74732e6769746c61622e696f2f6c756967692d77632d6d66652f6d61696e2e6a73'
)
.get('luigi-wc-687474703a2f2f6c6f63616c686f73743a383038302f6173736574732f6d61696e2e6a73')
.should('exist')
.shadow()
.should('not.exist'); // ShadowRoot in 'closed' mode
Expand All @@ -102,7 +98,7 @@ describe('create luigi-compound-container dynamically', () => {
const content = document.querySelector('.content');
const wc = document.createElement('luigi-compound-container');
wc.context = '{"invalid": "JSON}'
wc.viewurl = 'https://luigiwebcomponents.gitlab.io/nested2.js';
wc.viewurl = 'http://localhost:8080/assets/nested2.js';
wc.compoundConfig = {
eventListeners: [
Expand All @@ -123,7 +119,7 @@ describe('create luigi-compound-container dynamically', () => {
}
],
children: [{
viewUrl: 'https://luigiwebcomponents.gitlab.io/layouts/panelHeader.js',
viewUrl: 'http://localhost:8080/assets/panelHeader.js',
context: {
title: 'My Awesome Grid',
description: 'Really awesome'
Expand All @@ -140,23 +136,23 @@ describe('create luigi-compound-container dynamically', () => {
}
}]
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/layouts/panelFooter.js',
viewUrl: 'http://localhost:8080/assets/panelFooter.js',
context: {
footer: 'This is the end of awesomeness'
},
layoutConfig: {
slot: "footer"
}
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/luigiwebcomponentmf/main.js',
viewUrl: 'http://localhost:8080/assets/main.js',
layoutConfig: {
slot: "content"
},
context: {
label: 'I am nested!'
}
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/luigi-wc-mfe/main.js',
viewUrl: 'http://localhost:8080/assets/mfeMain.js',
context: {
label: 'Update Joke',
showAlert: false
Expand All @@ -180,7 +176,7 @@ describe('create luigi-compound-container dynamically', () => {
const content = document.querySelector('.content');
const wc = document.createElement('luigi-compound-container');
wc.context = { title: 'Nested' }
wc.viewurl = 'https://luigiwebcomponents.gitlab.io/nested2.js';
wc.viewurl = 'http://localhost:8080/assets/nested2.js';
wc.noShadow = true;
wc.compoundConfig = {
eventListeners: [
Expand All @@ -201,7 +197,7 @@ describe('create luigi-compound-container dynamically', () => {
}
],
children: [{
viewUrl: 'https://luigiwebcomponents.gitlab.io/layouts/panelHeader.js',
viewUrl: 'http://localhost:8080/assets/panelHeader.js',
context: {
title: 'My Awesome Grid',
description: 'Really awesome'
Expand All @@ -218,23 +214,23 @@ describe('create luigi-compound-container dynamically', () => {
}
}]
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/layouts/panelFooter.js',
viewUrl: 'http://localhost:8080/assets/panelFooter.js',
context: {
footer: 'This is the end of awesomeness'
},
layoutConfig: {
slot: "footer"
}
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/luigiwebcomponentmf/main.js',
viewUrl: 'http://localhost:8080/assets/main.js',
layoutConfig: {
slot: "content"
},
context: {
label: 'I am nested!'
}
}, {
viewUrl: 'https://luigiwebcomponents.gitlab.io/luigi-wc-mfe/main.js',
viewUrl: 'http://localhost:8080/assets/mfeMain.js',
context: {
label: 'Update Joke',
showAlert: false
Expand Down
5 changes: 2 additions & 3 deletions container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"public"
],
"scripts": {
"build": "npm run sync-event-typings && npm run generate-cem && rollup -c",
"build": "npm run sync-event-typings && npm run generate-cem && rollup -c",
"test": "jest",
"lint": "eslint src/**/*.*",
"bundle": "npm run build",
"dev": "rollup -c -w",
"copyBundle": "cp public/bundle.js public/bundle.js.map test-app/ && cp public/bundle.js public/bundle.js.map examples/ || COPY public\\* test-app\\",
"copyBundle": "cp public/bundle.js public/bundle.js.map test-app/ && cp public/bundle.js public/bundle.js.map examples/ || COPY public\\* test-app\\",
"copyLuigiClient": "cp ../client/public/luigi-client.js test-app/iframe",
"copyLuigiElement": "cp ../client/src/luigi-element.js test-app/compound",
"serve": "npm run build && npm run copyLuigiClient && npm run copyLuigiElement && npm run copyBundle && sirv -D -c test-app --no-clear",
Expand All @@ -31,7 +31,6 @@
"replace-version-in-docu": "node prepareNextRelease.js",
"sync-event-typings": "cp src/constants/communication.ts typings/constants/events.d.ts",
"generate-cem": "node generateCEM.js"

},
"devDependencies": {
"@babel/node": "7.22.10",
Expand Down
6 changes: 6 additions & 0 deletions container/test-app/assets/button.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions container/test-app/assets/icon.css

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions container/test-app/assets/input.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5358527

Please sign in to comment.