Skip to content

Commit ab9f7a4

Browse files
Revert "ofava/vidsol-291-header"
This reverts commit c08275d. ofava/vidsol-291-header Revert de49b37
1 parent 5b7752f commit ab9f7a4

File tree

10 files changed

+107
-26
lines changed

10 files changed

+107
-26
lines changed

.github/ISSUE_TEMPLATE/1-bug-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ body:
4646
- Chrome
4747
- Firefox
4848
- Microsoft Edge
49+
- Opera
4950
- Safari
5051
- Electron
5152

.github/workflows/run-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ jobs:
7474
/opt/firefox/firefox --version
7575
echo "Firefox latest downloaded and installed"
7676
77+
- name: Install opera latest
78+
run: |
79+
sudo mkdir -p /etc/apt/keyrings
80+
curl -fsSL https://deb.opera.com/archive.key | gpg --dearmor | sudo tee /etc/apt/keyrings/opera.gpg > /dev/null
81+
echo "deb [signed-by=/etc/apt/keyrings/opera.gpg] https://deb.opera.com/opera-stable/ stable non-free" | \
82+
sudo tee /etc/apt/sources.list.d/opera-stable.list > /dev/null
83+
sudo apt-get update
84+
sudo apt-get install opera-stable -y
85+
echo "Check opera version"
86+
/usr/bin/opera --version
87+
7788
- name: Setup node
7889
if: steps.check-skip-ci.outputs.result == 'false'
7990
uses: actions/setup-node@v4

.github/workflows/update-screenshots.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ jobs:
7272
echo "Check firefox version"
7373
/opt/firefox/firefox --version
7474
echo "Firefox latest downloaded and installed"
75+
- name: install opera latest
76+
if: steps.check-update-screenshots.outputs.result == 'true'
77+
run: |
78+
sudo add-apt-repository 'deb https://deb.opera.com/opera-stable/ stable non-free'
79+
wget -qO- https://deb.opera.com/archive.key | sudo apt-key add -
80+
sudo apt-get update
81+
sudo apt-get install opera-stable -y
82+
echo "Check opera version"
83+
/usr/bin/opera --version
84+
echo "Opera latest downloaded and installed"
7585
7686
- name: Checkout
7787
if: steps.check-update-screenshots.outputs.result == 'true'

eslint.config.mjs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,6 @@ export default [
258258
rules: {
259259
// unit test usually need to mock before importing to make the mocking work
260260
'import/first': 'off',
261-
'no-restricted-properties': [
262-
'warn',
263-
{ object: 'it', property: 'only', message: 'Remove .only from tests before committing!' },
264-
{
265-
object: 'describe',
266-
property: 'only',
267-
message: 'Remove .only from tests before committing!',
268-
},
269-
{ object: 'test', property: 'only', message: 'Remove .only from tests before committing!' },
270-
],
271261
},
272262
},
273263
];

integration-tests/fixtures/testWithLogging.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ const test = (() => {
5252
});
5353
}
5454

55+
if (projectType === 'Opera') {
56+
return baseTest.extend({
57+
page: async ({ context }, use) => {
58+
const page = await context.newPage();
59+
const loggedPage = addLogger(page, context);
60+
await use(loggedPage);
61+
await page.close();
62+
},
63+
});
64+
}
65+
5566
return baseTest.extend({
5667
page: async ({ page, context }, use) => {
5768
const loggedPage = addLogger(page, context);

integration-tests/globalSetup.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,34 @@
11
/* eslint-disable @typescript-eslint/no-require-imports */
2+
const { chromium } = require('@playwright/test');
3+
const path = require('path');
4+
const { exec } = require('child_process');
25
const startElectronApp = require('./electronHelper');
36

47
module.exports = async () => {
8+
const isOperaProject = process.argv.some((arg) => arg.includes('--project=Opera'));
59
const isElectronProject = process.argv.some((arg) => arg.includes('--project=Electron'));
10+
const isMac = process.platform === 'darwin';
11+
const executablePath = isMac ? '/Applications/Opera.app/Contents/MacOS/Opera' : '/usr/bin/opera';
12+
if (isOperaProject) {
13+
const projectType = process.env.PROJECT_TYPE || 'Opera';
14+
process.env.PROJECT_TYPE = projectType;
15+
const operaPath = path.resolve(executablePath);
16+
17+
exec(`${operaPath} --remote-debugging-port=9222`, (err) => {
18+
if (err) {
19+
console.error(`Error starting Opera: ${err}`);
20+
}
21+
});
22+
23+
await new Promise((resolve) => setTimeout(resolve, 3000));
24+
25+
try {
26+
const browser = await chromium.connectOverCDP('http://127.0.0.1:9222');
27+
global.browser = browser;
28+
} catch (error) {
29+
console.error('Error connecting to Opera:', error);
30+
}
31+
}
632

733
if (isElectronProject) {
834
const projectType = process.env.PROJECT_TYPE || 'Electron';

integration-tests/playwright.config.ts

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const chromiumFlags = [
1717
const width = 1512;
1818
const height = 824;
1919

20+
const isMac = process.platform === 'darwin';
21+
22+
const executablePath = isMac ? '/Applications/Opera.app/Contents/MacOS/Opera' : '/usr/bin/opera';
23+
2024
const fakeDeviceChromiumFlags = [
2125
...chromiumFlags,
2226
'--headless=new',
@@ -53,7 +57,9 @@ export default defineConfig({
5357
...devices['Desktop Chrome'],
5458
viewport: { width, height },
5559
channel: 'chrome',
56-
launchOptions: { args: chromiumFlags },
60+
launchOptions: {
61+
args: chromiumFlags,
62+
},
5763
},
5864
},
5965
{
@@ -62,7 +68,9 @@ export default defineConfig({
6268
...devices['Desktop Chrome'],
6369
viewport: { width, height },
6470
channel: 'chrome',
65-
launchOptions: { args: fakeDeviceChromiumFlags },
71+
launchOptions: {
72+
args: fakeDeviceChromiumFlags,
73+
},
6674
},
6775
},
6876
{
@@ -98,15 +106,28 @@ export default defineConfig({
98106
...devices['Desktop Edge'],
99107
viewport: { width, height },
100108
channel: 'msedge',
101-
launchOptions: { args: fakeDeviceChromiumFlags },
109+
launchOptions: {
110+
args: fakeDeviceChromiumFlags,
111+
},
102112
},
103113
},
104114
{
105115
name: 'Mobile Chrome',
106116
use: {
107117
...devices['Pixel 5'],
108-
launchOptions: { args: fakeDeviceChromiumFlags },
109-
viewport: { width: 393, height: 851 },
118+
launchOptions: {
119+
args: fakeDeviceChromiumFlags,
120+
},
121+
},
122+
},
123+
{
124+
name: 'Opera',
125+
use: {
126+
viewport: { width, height },
127+
launchOptions: {
128+
args: fakeDeviceChromiumFlags,
129+
executablePath,
130+
},
110131
},
111132
},
112133
{
@@ -115,7 +136,9 @@ export default defineConfig({
115136
launchOptions: {
116137
args: ['--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream'],
117138
},
118-
contextOptions: { viewport: { width, height } },
139+
contextOptions: {
140+
viewport: { width, height },
141+
},
119142
},
120143
},
121144
],

integration-tests/project.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"executor": "nx:run-commands",
1010
"options": {
1111
"cwd": "integration-tests",
12-
"command": "playwright test --project='Google Chrome Fake Devices' --project=firefox --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron'"
12+
"command": "playwright test --project='Google Chrome Fake Devices' --project=firefox --project='Opera' --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron'"
1313
}
1414
},
1515
"updateScreenshots": {
1616
"executor": "nx:run-commands",
1717
"cache": false,
1818
"options": {
1919
"cwd": "integration-tests",
20-
"command": "playwright test --project='Google Chrome Fake Devices' --project=firefox --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron' --update-snapshots"
20+
"command": "playwright test --project='Google Chrome Fake Devices' --project=firefox --project='Opera' --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron' --update-snapshots"
2121
}
2222
},
2323
"updateScreenshots:": {
@@ -28,12 +28,15 @@
2828
"options": {
2929
"cwd": "integration-tests",
3030
"description": "Update snapshots only for one Playwright test file",
31-
"command": "playwright test {args._} --project='Google Chrome Fake Devices' --project=firefox --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron' --update-snapshots"
31+
"command": "playwright test {args._} --project='Google Chrome Fake Devices' --project=firefox --project='Opera' --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron' --update-snapshots"
3232
}
3333
},
3434
"postinstall": {
3535
"executor": "nx:run-commands",
36-
"options": { "cwd": "integration-tests", "command": "playwright install" }
36+
"options": {
37+
"cwd": "integration-tests",
38+
"command": "playwright install"
39+
}
3740
},
3841
"ts-check": {
3942
"executor": "nx:run-commands",
@@ -55,7 +58,7 @@
5558
"options": {
5659
"cwd": "integration-tests",
5760
"description": "Run playwright tests in a specific file",
58-
"command": "playwright test {args._} --project='Google Chrome Fake Devices' --project=firefox --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron'"
61+
"command": "playwright test {args._} --project='Google Chrome Fake Devices' --project=firefox --project='Opera' --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron'"
5962
}
6063
}
6164
},

libs/ui/vite.config.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ export default defineConfig(() => ({
1111
react(),
1212
dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') }),
1313
],
14-
resolve: { alias: { '@ui': path.resolve(__dirname, './src') } },
14+
resolve: {
15+
alias: {
16+
'@ui': path.resolve(__dirname, './src'),
17+
},
18+
},
1519
// Uncomment this if you are using workers.
1620
// worker: {
1721
// plugins: [ nxViteTsPaths() ],
@@ -38,11 +42,13 @@ export default defineConfig(() => ({
3842
},
3943
},
4044
test: {
45+
name: 'ui',
46+
watch: false,
4147
globals: true,
4248
environment: 'jsdom',
4349
setupFiles: './test/setup.ts',
44-
css: true,
45-
server: { deps: { fallbackCJS: true, inline: ['cliui', 'yargs', 'wrap-ansi'] } },
46-
coverage: { provider: 'v8' as const, reporter: ['text', 'lcov'] },
50+
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
51+
reporters: ['default'],
52+
coverage: { reportsDirectory: './test-output/vitest/coverage', provider: 'v8' as const },
4753
},
4854
}));

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ sonar.sourceEncoding=UTF-8
1414
sonar.exclusions=**/*.spec.tsx,**/*.spec.ts,**/*.test.ts,tests/**,node_modules/**,integration-tests/**,scripts/**,frontend/src/designTokens/**,\
1515
customWordList.mjs,\
1616
eslint.config.mjs,\
17-
frontend/tailwind.config.ts,
17+
frontend/tailwind.config.js,
1818

1919
sonar.javascript.lcov.reportPaths=**/coverage/lcov.info

0 commit comments

Comments
 (0)