Skip to content

Commit

Permalink
Merge pull request #425 from Fekide/test/strapi-4.25
Browse files Browse the repository at this point in the history
test(e2e): update strapi versions
  • Loading branch information
sargreal authored Sep 13, 2024
2 parents 0621f4e + b15d38a commit 57a431a
Show file tree
Hide file tree
Showing 9 changed files with 685 additions and 517 deletions.
22 changes: 9 additions & 13 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
- package-ecosystem: 'npm'
directory: '/plugin/'
schedule:
interval: 'weekly'
- package-ecosystem: 'npm'
directory: '/providers/deepl/'
schedule:
interval: 'weekly'
- package-ecosystem: 'npm'
directory: '/playground/'
directories:
- '/'
- '/plugin/'
- '/providers/*'
- '/playground/'
schedule:
interval: 'weekly'
groups:
strapi:
patterns:
- "@strapi/*"
30 changes: 23 additions & 7 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,38 @@ jobs:
strategy:
matrix:
node: [18, 20]
strapi: [4.14, 4.15, 4.19]
strapi: [4.19, 4.24, 4.25]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- run: VERSION=${{ matrix.strapi }} envsubst < playground/templates/template.package.json > playground/package.json
- run: yarn
- run: yarn workspace playground build
- run: yarn workspace playground e2e
- name: Install workspace dependencies
run: yarn
- name: Pack strapi-plugin-translate
run: yarn workspace strapi-plugin-translate pack -f strapi-plugin-translate.tgz
- name: Copy playground to e2e folder
run: cp -r playground e2e
- name: Configure strapi version for e2e test
run: VERSION=${{ matrix.strapi }} envsubst < e2e/templates/template.package.json > e2e/package.json
- name: Install e2e dependencies
run: yarn
working-directory: e2e
- name: Add local strapi-plugin-translate
run: yarn add ../plugin/strapi-plugin-translate.tgz
working-directory: e2e
- name: Build strapi for e2e tests
run: yarn build
working-directory: e2e
- name: Run e2e tests
run: yarn e2e
working-directory: e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress results (node=${{ matrix.node }},strapi=${{ matrix.strapi }})
path: |
playground/cypress/videos/*
playground/cypress/screenshots/*
e2e/cypress/videos/*
e2e/cypress/screenshots/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
This plugin requires the following, in order to work correctly:

- Strapi v4 (this plugin is not compatible with v3)
- Plugin tested for `v4.6` to `v4.9`
- Plugin tested for `v4.19` to `v4.25`
- The plugin **i18n** installed and enabled (`@strapi/plugin-i18n` [[npm](https://www.npmjs.com/package/@strapi/plugin-i18n)])
- The content type to have internationalization enabled (advanced settings in the content type builder)
- In the internationalization settings at least **two** locales
Expand Down
8 changes: 4 additions & 4 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"test": "echo no unittests"
},
"dependencies": {
"@strapi/plugin-i18n": "4.19.1",
"@strapi/plugin-users-permissions": "4.19.1",
"@strapi/strapi": "4.19.1",
"@strapi/plugin-i18n": "4.25.10",
"@strapi/plugin-users-permissions": "4.25.10",
"@strapi/strapi": "4.25.10",
"better-sqlite3": "9.4.0",
"dotenv": "^16.4.1",
"lodash": "^4.17.21",
Expand All @@ -35,7 +35,7 @@
"start-server-and-test": "^2.0.3"
},
"engines": {
"node": ">=14.19.1 <=20.x.x",
"node": ">=14 <=20",
"npm": ">=6.0.0"
},
"strapi": {
Expand Down
2 changes: 1 addition & 1 deletion playground/templates/template.package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"start-server-and-test": "^2.0.3"
},
"engines": {
"node": ">=14.19.1 <=20.x.x",
"node": ">=14 <=20",
"npm": ">=6.0.0"
},
"strapi": {
Expand Down
2 changes: 1 addition & 1 deletion plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
This plugin requires the following, in order to work correctly:

- Strapi v4 (this plugin is not compatible with v3)
- Plugin tested for `v4.6` to `v4.9`
- Plugin tested for `v4.19` to `v4.25`
- The plugin **i18n** installed and enabled (`@strapi/plugin-i18n` [[npm](https://www.npmjs.com/package/@strapi/plugin-i18n)])
- The content type to have internationalization enabled (advanced settings in the content type builder)
- In the internationalization settings at least **two** locales
Expand Down
5 changes: 4 additions & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"@faker-js/faker": "^8.4.0",
"@strapi/plugin-i18n": "^4.15.0",
"axios-mock-adapter": "^2.0.0",
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"react": "^17.0 || ^18.0",
"react-dom": "^17.0 || ^18.0",
"react-router-dom": "^5.2.0"
},
"peerDependencies": {
"@strapi/plugin-i18n": "^4.1.4",
Expand Down
4 changes: 3 additions & 1 deletion providers/deepl/lib/__tests__/parse-locale.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
'use strict'

const locales = require('@strapi/plugin-i18n/server/constants/iso-locales.json')
const i18n = require('@strapi/plugin-i18n/strapi-server')
const { parseLocale } = require('../parse-locale')

const locales = i18n().services["iso-locales"]().getIsoLocales()

function supportedLocale({ code, name }) {
// Swiss German is not supported
if (code.includes('gsw')) return false
Expand Down
Loading

0 comments on commit 57a431a

Please sign in to comment.