Skip to content

Commit ca9f998

Browse files
committed
Update action, fix linter
1 parent 87d4ae4 commit ca9f998

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

.github/workflows/frontend.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@ jobs:
2727
- name: Install dependencies
2828
run: npm ci
2929

30-
- name: Install Playwright browsers
31-
run: npx playwright install --with-deps
30+
- name: Install Playwright Chromium browser
31+
run: npx playwright install --with-deps chromium
3232

33-
- name: Run linting
33+
- name: Run linter
3434
run: npx gulp lint
3535

3636
- name: Run E2E tests with coverage
37-
run: npm run e2e
37+
run: |
38+
npm run e2e
39+
npm run e2e:coverage:report
3840
39-
- name: Generate coverage report
40-
if: always()
41-
run: npm run e2e:coverage:report
4241
4342
- name: Upload coverage reports
4443
if: always()

djangocms_versioning/static/djangocms_versioning/js/compare.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ function bindHandlers(submitButton) {
66
}
77

88
window.addEventListener('load', function() {
9-
document.querySelector('select[name=action]').addEventListener('change', function() {
10-
let selectVal = this.options[this.selectedIndex].getAttribute("value");
11-
const actionsForm = document.getElementById('changelist-form')
12-
const submitButton = actionsForm.querySelector('[type="submit"]')
9+
document.querySelector('select[name=action]').addEventListener('change', function() {
10+
let selectVal = this.options[this.selectedIndex].getAttribute('value');
11+
const actionsForm = document.getElementById('changelist-form');
12+
const submitButton = actionsForm.querySelector('[type="submit"]');
1313

1414
if (selectVal === 'compare_versions') {
1515
// Setting the target to blank to ensure the compare view is opened in a new tab
16-
actionsForm.setAttribute('target', '_blank');
17-
bindHandlers(submitButton);
18-
}else {
16+
actionsForm.setAttribute('target', '_blank');
17+
bindHandlers(submitButton);
18+
} else {
1919
// If the user deselect the compare version action, the "target=_blank" is removed
2020
actionsForm.removeAttribute('target');
2121
}

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@
5050
"srcdoc-polyfill": "^1.0.0"
5151
},
5252
"browserslist": [
53-
"last 2 Chrome versions",
54-
"last 2 Firefox versions",
55-
"last 2 Safari versions",
56-
"last 2 Edge versions"
53+
"last 2 Chrome versions"
5754
],
5855
"nyc": {
5956
"reporter": ["lcov", "text-summary"],

playwright.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ module.exports = defineConfig({
1313
baseURL: 'http://localhost:8089',
1414
headless: true,
1515
},
16+
projects: [
17+
{
18+
name: 'chromium',
19+
use: { browserName: 'chromium' },
20+
},
21+
],
1622
});

0 commit comments

Comments
 (0)