-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update UI5 from v1 to v2 #3542
base: main
Are you sure you want to change the base?
Changes from 38 commits
e5930e3
527ab33
cd703c0
0ff4119
7b1e4dc
9c39bff
ba9135e
ce4764e
c85f1bd
a565ab1
a486ff6
c702d0c
da69d7c
57d5921
7a03881
dd3e052
5e543ee
bcf9884
23431fc
dc93f43
3517ff7
5b7fd61
4120fed
71908da
049a830
764bf23
445f263
f0cf797
5f41290
cedc25c
413b65f
eb90c63
16c7efb
ec75207
589bf60
0bace38
e9ea9fb
34644e6
150d427
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,16 +1,19 @@ | ||||||
name: PR Unit Tests | ||||||
name: PR Unit and Component Tests | ||||||
|
||||||
on: | ||||||
on: | ||||||
pull_request: | ||||||
types: [opened, edited, synchronize, reopened, ready_for_review] | ||||||
paths: | ||||||
- ".github/workflows/pull-unit-tests.yml" | ||||||
- "public/**" | ||||||
- "src/**" | ||||||
- "package.json" | ||||||
- '.github/workflows/pull-unit-tests.yml' | ||||||
- 'public/**' | ||||||
- 'src/**' | ||||||
- 'backend/**' | ||||||
- 'package.json' | ||||||
- 'cypress/support/**' | ||||||
- 'cypress.config.component.ts' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To consider, in my opinion we need to run this workflow every time when something will be changed in whole cypress.
Suggested change
|
||||||
|
||||||
jobs: | ||||||
run-unit-test: | ||||||
run-unit-and-component-test: | ||||||
runs-on: ubuntu-latest | ||||||
if: github.event.pull_request.draft == false | ||||||
steps: | ||||||
|
@@ -27,7 +30,11 @@ jobs: | |||||
run: | | ||||||
set -e | ||||||
npm ci | ||||||
- name: run_tests | ||||||
- name: run_unit_tests | ||||||
shell: bash | ||||||
run: | | ||||||
run: | | ||||||
npm run test | ||||||
- name: run_component_tests | ||||||
shell: bash | ||||||
run: | | ||||||
npm run component-test-headless |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from 'cypress'; | ||
|
||
export default defineConfig({ | ||
component: { | ||
screenshotOnRunFailure: false, | ||
includeShadowDom: true, | ||
devServer: { | ||
framework: 'react', | ||
bundler: 'vite', | ||
}, | ||
specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}', | ||
supportFile: 'cypress/support/component.jsx', | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> | ||
<title>Components App</title> | ||
</head> | ||
<body> | ||
<div data-cy-root></div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* global Cypress */ | ||
import React from 'react'; | ||
import { mount } from 'cypress/react18'; | ||
import { ThemeProvider } from '@ui5/webcomponents-react'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
import { RecoilRoot } from 'recoil'; | ||
|
||
import i18n from 'i18next'; | ||
import { initReactI18next } from 'react-i18next'; | ||
import { I18nextProvider } from 'react-i18next'; | ||
|
||
i18n.use(initReactI18next).init({ | ||
lng: 'en', | ||
fallbackLng: false, | ||
nsSeparator: '::', | ||
defaultNS: 'translation', | ||
saveMissing: true, | ||
interpolation: { | ||
escapeValue: false, | ||
}, | ||
}); | ||
|
||
Cypress.Commands.add( | ||
'mount', | ||
(component, { initializeRecoil, ...options } = {}) => { | ||
return mount( | ||
<RecoilRoot initializeState={initializeRecoil}> | ||
<I18nextProvider i18n={i18n}> | ||
<MemoryRouter> | ||
<ThemeProvider>{component}</ThemeProvider> | ||
</MemoryRouter> | ||
</I18nextProvider> | ||
</RecoilRoot>, | ||
options, | ||
); | ||
}, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
http-equiv="Content-Security-Policy" | ||
content="font-src 'self' https://sdk.openui5.org/; script-src 'self' blob:; object-src 'self';" | ||
content="font-src 'self' https://sdk.openui5.org/; script-src 'self' 'unsafe-eval' blob:; object-src 'self';" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change should be also on the main, please double-check if there is no problem between the main and feature-branch |
||
/> | ||
<title>Busola</title> | ||
</head> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove it, but it will be nice to have it documented in internal docs, how to do this, in case same problem will appear in the future