Skip to content

Commit 142b6a6

Browse files
authored
Merge pull request #1082 from flatcar/fix/minor-style-issues
refactor(frontend): migrate to MUI v5 sx styling
2 parents e8de8b3 + 0db9766 commit 142b6a6

File tree

13 files changed

+1259
-1219
lines changed

13 files changed

+1259
-1219
lines changed

frontend/.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { StorybookConfig } from '@storybook/react-vite';
1+
import { type StorybookConfig } from '@storybook/react-vite';
22

33
const config: StorybookConfig = {
44
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { expect, test } from '@playwright/test';
2+
3+
import { createApplication, deleteApplication, generateSalt } from './helpers';
4+
5+
test.describe('Application Item Style', () => {
6+
let appName: string;
7+
let appId: string;
8+
9+
test.beforeEach(async ({ page }, testInfo): Promise<void> => {
10+
const appNameSalt = generateSalt(testInfo.title);
11+
appName = 'Sty';
12+
appId = 'io.test.style.app.' + appNameSalt;
13+
14+
await page.goto('/');
15+
});
16+
17+
test.afterEach(async ({ page }) => {
18+
await deleteApplication(page, appName);
19+
20+
await expect(page.getByRole('list')).not.toContainText(appName);
21+
await expect(page.getByRole('list')).not.toContainText(appId);
22+
});
23+
24+
test('should display application item with correct width styling', async ({ page }) => {
25+
await createApplication(page, appName, appId);
26+
27+
await expect(page.getByRole('list')).toContainText(appName);
28+
await expect(page.getByRole('list')).toContainText(appId);
29+
30+
const appItem = page.locator('li').filter({ hasText: appName });
31+
32+
await appItem.scrollIntoViewIfNeeded();
33+
34+
await page.evaluate(() => {
35+
const items = Array.from(document.querySelectorAll('li'));
36+
const targetItem = items.find(li => li.textContent?.includes('Test style app'));
37+
38+
if (targetItem) {
39+
const rect = targetItem.getBoundingClientRect();
40+
const scrollTop = window.pageYOffset + rect.top - 100;
41+
window.scrollTo(0, scrollTop);
42+
}
43+
});
44+
45+
await page.waitForTimeout(500);
46+
47+
await expect(appItem).toHaveScreenshot('application-item-style.png', {
48+
clip: {
49+
x: 0,
50+
y: -10,
51+
width: await appItem.boundingBox().then(box => box?.width || 800),
52+
height: await appItem.boundingBox().then(box => (box?.height || 200) + 20),
53+
},
54+
});
55+
});
56+
});
16.8 KB
Loading

0 commit comments

Comments
 (0)