Skip to content

Commit 9a53ebf

Browse files
committed
Merge branch 'vlt8' of https://github.com/kitconcept/volto-button-block into vlt8
* 'vlt8' of https://github.com/kitconcept/volto-button-block: Form CI update lock
2 parents 8c3c12f + c629df3 commit 9a53ebf

File tree

11 files changed

+1762
-770
lines changed

11 files changed

+1762
-770
lines changed

.github/workflows/acceptance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- ".github/workflows/acceptance.yml"
1111

1212
env:
13-
NODE_VERSION: 20.x
13+
NODE_VERSION: 24.x
1414
CYPRESS_RETRIES: 2
1515

1616
jobs:

.github/workflows/changelog.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
env:
9-
node-version: 20.x
9+
NODE_VERSION: 24.x
1010
ADDON_NAME: volto-button-block
1111

1212
jobs:
@@ -21,18 +21,13 @@ jobs:
2121
- name: Install pipx
2222
run: pip install towncrier
2323

24-
- name: Use Node.js ${{ env.node-version }}
24+
- name: Use Node.js
2525
uses: actions/setup-node@v4
2626
with:
27-
node-version: ${{ env.node-version }}
27+
node-version: ${{ env.NODE_VERSION }}
2828

29-
- uses: pnpm/action-setup@v3
30-
name: Install pnpm
31-
with:
32-
version: 8
33-
# We don't want to install until later,
34-
# when the cache and Cypress are in place
35-
run_install: false
29+
- name: Enable corepack
30+
run: corepack enable
3631

3732
- name: Get pnpm store directory
3833
shell: bash
@@ -48,7 +43,8 @@ jobs:
4843
${{ runner.os }}-pnpm-store-
4944
5045
- name: Install dependencies
51-
run: make install
46+
run: |
47+
make install
5248
5349
- name: Check for presence of a Change Log fragment (only pull requests)
5450
run: |

.github/workflows/code.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
name: Code analysis checks
2-
on: [push]
2+
on:
3+
push:
4+
paths:
5+
- "*.js"
6+
- "*.json"
7+
- "*.yaml"
8+
- "packages/**"
9+
- ".github/workflows/code.yml"
10+
11+
env:
12+
NODE_VERSION: 24.x
13+
314
jobs:
415
codeanalysis:
516
runs-on: ubuntu-latest
@@ -8,18 +19,13 @@ jobs:
819
- name: Main checkout
920
uses: actions/checkout@v4
1021

11-
- name: Use Node.js 20.x
22+
- name: Use Node.js
1223
uses: actions/setup-node@v4
1324
with:
14-
node-version: 20.x
25+
node-version: ${{ env.NODE_VERSION }}
1526

16-
- uses: pnpm/action-setup@v3
17-
name: Install pnpm
18-
with:
19-
version: 8
20-
# We don't want to install until later,
21-
# when the cache and Cypress are in place
22-
run_install: false
27+
- name: Enable corepack
28+
run: corepack enable
2329

2430
- name: Get pnpm store directory
2531
shell: bash

.github/workflows/i18n.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
name: i18n
2-
on: [push]
2+
on:
3+
push:
4+
paths:
5+
- "*.js"
6+
- "*.json"
7+
- "*.yaml"
8+
- "packages/**"
9+
- ".github/workflows/i18n.yml"
10+
11+
env:
12+
NODE_VERSION: 24.x
13+
314
jobs:
415
unit:
516
runs-on: ubuntu-latest
@@ -8,18 +19,13 @@ jobs:
819
- name: Main checkout
920
uses: actions/checkout@v4
1021

11-
- name: Use Node.js 20.x
22+
- name: Use Node.js
1223
uses: actions/setup-node@v4
1324
with:
14-
node-version: 20.x
25+
node-version: ${{ env.NODE_VERSION }}
1526

16-
- uses: pnpm/action-setup@v3
17-
name: Install pnpm
18-
with:
19-
version: 8
20-
# We don't want to install until later,
21-
# when the cache and Cypress are in place
22-
run_install: false
27+
- name: Enable corepack
28+
run: corepack enable
2329

2430
- name: Get pnpm store directory
2531
shell: bash

.github/workflows/unit.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
name: Unit Tests
2-
on: [push]
2+
on:
3+
push:
4+
paths:
5+
- "*.js"
6+
- "*.json"
7+
- "*.yaml"
8+
- "packages/**"
9+
- ".github/workflows/unit.yml"
10+
11+
env:
12+
NODE_VERSION: 24.x
13+
314
jobs:
415
unit:
516
runs-on: ubuntu-latest
@@ -8,18 +19,13 @@ jobs:
819
- name: Main checkout
920
uses: actions/checkout@v4
1021

11-
- name: Use Node.js 20.x
22+
- name: Use Node.js
1223
uses: actions/setup-node@v4
1324
with:
14-
node-version: 20.x
25+
node-version: ${{ env.NODE_VERSION }}
1526

16-
- uses: pnpm/action-setup@v3
17-
name: Install pnpm
18-
with:
19-
version: 8
20-
# We don't want to install until later,
21-
# when the cache and Cypress are in place
22-
run_install: false
27+
- name: Enable corepack
28+
run: corepack enable
2329

2430
- name: Get pnpm store directory
2531
shell: bash
@@ -38,4 +44,4 @@ jobs:
3844
run: make install
3945

4046
- name: Unit tests
41-
run: make test-ci
47+
run: make ci-test

cypress/support/index.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
namespace Cypress {
2+
export interface Chainable {
3+
/**
4+
* Custom command to select DOM element by data-cy attribute.
5+
* @example cy.dataCy('greeting')
6+
*/
7+
navigate(value: string): Chainable<JQuery<HTMLElement>>;
8+
getSlateEditorAndType(value: string): Chainable<JQuery<HTMLElement>>;
9+
setSlateSelection(value: string): Chainable<JQuery<HTMLElement>>;
10+
clickSlateButton(value: string): Chainable<JQuery<HTMLElement>>;
11+
autologin(): Chainable<JQuery<HTMLElement>>;
12+
createContent({
13+
contentType,
14+
contentId,
15+
contentTitle,
16+
path,
17+
bodyModifier,
18+
preview_image_link,
19+
}: {
20+
contentType: string;
21+
contentId: string;
22+
contentTitle: string;
23+
path?: string;
24+
bodyModifier?: (body: any) => any;
25+
preview_image_link?: { '@id': string };
26+
}): Chainable<JQuery<HTMLElement>>;
27+
addNewBlock(value: string): Chainable<JQuery<HTMLElement>>;
28+
matchImage(): Chainable<JQuery<HTMLElement>>;
29+
injectAxe({
30+
axeCorePath,
31+
}: {
32+
axeCorePath: string;
33+
}): Chainable<JQuery<HTMLElement>>;
34+
checkA11y(
35+
context?: Object | string,
36+
options?: Object,
37+
violationCallback?: (violations: any[]) => void,
38+
skipFailures?: boolean,
39+
): Chainable<JQuery<HTMLElement>>;
40+
checkAccessibility(): Chainable<JQuery<HTMLElement>>;
41+
getSlate(): Chainable<JQuery<HTMLElement>>;
42+
}
43+
}

cypress/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": ["es5", "dom"],
5+
"types": ["cypress", "@testing-library/cypress", "node"]
6+
},
7+
"include": ["**/*.ts"]
8+
}

jest-addon.config.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"build": "VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto build",
2323
"build:deps": "pnpm --filter @plone/registry --filter @plone/components build",
2424
"i18n": "pnpm --filter addons i18n",
25-
"test": "RAZZLE_JEST_CONFIG=$(pwd)/jest-addon.config.js pnpm --filter @plone/volto test",
25+
"test": "pnpm --filter @kitconcept/volto-button-block exec vitest",
2626
"lint": "VOLTOCONFIG=$(pwd)/volto.config.js eslint --max-warnings=0 'packages/**/src/**/*.{js,jsx,ts,tsx}'",
2727
"lint:fix": "VOLTOCONFIG=$(pwd)/volto.config.js eslint --fix 'packages/**/src/**/*.{js,jsx,ts,tsx}'",
2828
"prettier": "prettier --check 'packages/**/src/**/*.{js,jsx,ts,tsx}'",
@@ -51,4 +51,4 @@
5151
}
5252
},
5353
"packageManager": "pnpm@9.1.1"
54-
}
54+
}

0 commit comments

Comments
 (0)