glib-web 4.44.4 → 4.44.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,12 +2,12 @@ import { testPageUrl } from "../../helper"
|
|
|
2
2
|
|
|
3
3
|
const url = testPageUrl('fields_captcha')
|
|
4
4
|
|
|
5
|
-
const visitWithCaptcha = (executeResult
|
|
5
|
+
const visitWithCaptcha = (executeResult) => {
|
|
6
6
|
cy.visit(url, {
|
|
7
|
-
onBeforeLoad(win
|
|
8
|
-
|
|
7
|
+
onBeforeLoad(win) {
|
|
8
|
+
win.grecaptcha = {
|
|
9
9
|
enterprise: {
|
|
10
|
-
ready: function(cb
|
|
10
|
+
ready: function(cb) { cb(); },
|
|
11
11
|
execute: function() { return executeResult(); }
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -2,7 +2,11 @@ import { testPageUrl } from "../../helper"
|
|
|
2
2
|
|
|
3
3
|
const url = testPageUrl('panels_bulkEdit2')
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const csvFixtureContents = [
|
|
6
|
+
'month,electricity_usage,gas_usage,sources,compliant',
|
|
7
|
+
'January,120,10,Generators,yes',
|
|
8
|
+
'February,150,12,Solar Panels,no'
|
|
9
|
+
].join('\n')
|
|
6
10
|
|
|
7
11
|
describe('panels_bulkEdit2', () => {
|
|
8
12
|
it('loads csv rows and toggles column variants', () => {
|
|
@@ -10,7 +14,14 @@ describe('panels_bulkEdit2', () => {
|
|
|
10
14
|
|
|
11
15
|
cy.contains('Drag your CSV file here').should('exist')
|
|
12
16
|
|
|
13
|
-
cy.get('input[type="file"]').selectFile(
|
|
17
|
+
cy.get('input[type="file"]').selectFile(
|
|
18
|
+
{
|
|
19
|
+
contents: Cypress.Buffer.from(csvFixtureContents),
|
|
20
|
+
fileName: 'bulk_edit.csv',
|
|
21
|
+
mimeType: 'text/csv'
|
|
22
|
+
},
|
|
23
|
+
{ force: true }
|
|
24
|
+
)
|
|
14
25
|
|
|
15
26
|
cy.get('tbody tr').should('have.length', 2)
|
|
16
27
|
cy.contains('Submit (top)').should('be.visible')
|
package/cypress/helper.ts
CHANGED
package/cypress.yml.example
CHANGED
|
@@ -43,13 +43,13 @@ jobs:
|
|
|
43
43
|
- run: cp config/database.yml.github-actions config/database.yml
|
|
44
44
|
- run: bundle exec rake db:test:prepare
|
|
45
45
|
- run: bundle exec rails server -d
|
|
46
|
-
- name: Cypress run
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
- name: Cypress run (e2e)
|
|
47
|
+
run: env -u ELECTRON_RUN_AS_NODE yarn cypress run --browser chrome
|
|
48
|
+
- name: Cypress run (component)
|
|
49
|
+
run: env -u ELECTRON_RUN_AS_NODE yarn cypress run --component
|
|
50
50
|
- name: Upload screenshots
|
|
51
51
|
uses: actions/upload-artifact@v4
|
|
52
52
|
if: failure()
|
|
53
53
|
with:
|
|
54
54
|
name: cypress-screenshots
|
|
55
|
-
path: cypress/screenshots
|
|
55
|
+
path: cypress/screenshots
|
package/index.js
CHANGED
|
@@ -61,6 +61,7 @@ import CommonResponsive from "./components/responsive.vue";
|
|
|
61
61
|
import CommonTemplateMenu from "./templates/_menu.vue";
|
|
62
62
|
import BigProgressCircle from "./templates/bigProgressCircle.vue";
|
|
63
63
|
import RichButton from "./components/button.vue";
|
|
64
|
+
import Dom from "./utils/dom";
|
|
64
65
|
Vue.component("panels-vertical", VerticalPanel);
|
|
65
66
|
Vue.component("panels-responsive", ResponsivePanel);
|
|
66
67
|
Vue.component("common-avatar", CommonAvatar);
|
|
@@ -123,6 +124,7 @@ const vPhoneInput = createVPhoneInput({
|
|
|
123
124
|
|
|
124
125
|
Vue.use(vPhoneInput);
|
|
125
126
|
|
|
127
|
+
Dom.ensureCsrfElement();
|
|
126
128
|
|
|
127
129
|
document.addEventListener("DOMContentLoaded", () => {
|
|
128
130
|
Vue.mount(`#${APP_ID}`);
|
package/package.json
CHANGED
package/utils/dom.js
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
import * as TypeUtils from "./type";
|
|
2
|
+
|
|
1
3
|
export default class {
|
|
4
|
+
static ensureCsrfElement() {
|
|
5
|
+
let element = document.querySelector('meta[name="csrf-token"]');
|
|
6
|
+
if (!TypeUtils.isObject(element)) {
|
|
7
|
+
const meta = document.createElement("meta");
|
|
8
|
+
meta.setAttribute("name", "csrf-token");
|
|
9
|
+
meta.setAttribute("content", "");
|
|
10
|
+
if (TypeUtils.isObject(document.head)) {
|
|
11
|
+
document.head.appendChild(meta);
|
|
12
|
+
} else {
|
|
13
|
+
document.documentElement.appendChild(meta);
|
|
14
|
+
}
|
|
15
|
+
element = meta;
|
|
16
|
+
}
|
|
17
|
+
return element;
|
|
18
|
+
}
|
|
19
|
+
|
|
2
20
|
static get csrfElement() {
|
|
3
|
-
return
|
|
21
|
+
return this.ensureCsrfElement();
|
|
4
22
|
}
|
|
5
23
|
|
|
6
24
|
static getCsrf() {
|