-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: detail scroll not being able to scroll all the way down (#3304)
- Loading branch information
1 parent
4c02e9b
commit b85a177
Showing
46 changed files
with
204 additions
and
184 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,4 @@ | |
} | ||
:host([mode='open']) { | ||
@apply h-1/2; | ||
|
||
.scrollable { | ||
@apply h-full overflow-y-auto overflow-x-hidden; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
packages/elements/test/integration/drawer-mutant.it.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import type { MutantDot } from './po/MutantDot.po.js'; | ||
import type { Drawer } from './po/Drawer.po.js'; | ||
import { ReportPage } from './po/ReportPage.js'; | ||
import { actScreenshotMatch } from './lib/helpers.js'; | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test.describe('Drawer mutant view', () => { | ||
let page: ReportPage; | ||
|
||
test.beforeEach(async ({ page: p }) => { | ||
page = new ReportPage(p); | ||
await page.navigateTo('test-files-example/#mutant/deep-merge.ts'); | ||
}); | ||
|
||
test.describe('when a mutant is opened', () => { | ||
let drawer: Drawer; | ||
let mutant: MutantDot; | ||
test.beforeEach(async () => { | ||
mutant = page.mutantView.mutantDot(20); | ||
await mutant.toggle(); | ||
drawer = page.mutantView.mutantDrawer(); | ||
await page.mutantView.scrollToCode(); | ||
}); | ||
|
||
test('should show a summary in the drawer when a mutant is clicked', async () => { | ||
await drawer.whenHalfOpen(); | ||
await expect(drawer.header).toHaveText('👽 ConditionalExpression Survived (15:41)'); | ||
}); | ||
|
||
test('should look as expected', async ({ page: p }, testInfo) => { | ||
await drawer.whenHalfOpen(); | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
|
||
test('should look as expected in dark mode', async ({ page: p }, testInfo) => { | ||
await page.themeSelector.select('dark'); | ||
await drawer.whenHalfOpen(); | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
|
||
test('should show the statusReason', async ({ page: p }, testInfo) => { | ||
// Mutant 17 has a statusReason | ||
await page.mutantView.mutantDot(17).toggle(); | ||
await drawer.whenHalfOpen(); | ||
await expect(drawer.summary()).toContainText('Survived despite covered by 3 tests'); | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
|
||
test('should close the drawer when deselecting the mutant', async () => { | ||
await mutant.toggle(); | ||
await drawer.whenClosed(); | ||
}); | ||
|
||
test('should show the details of the next mutant when another mutant is selected', async () => { | ||
await page.mutantView.mutantDot(24).toggle(); | ||
await drawer.whenHalfOpen(); | ||
await expect(drawer.header).toHaveText('👽 ConditionalExpression Survived (15:77)'); | ||
}); | ||
|
||
test('should hide the drawer when the user clicks somewhere else', async () => { | ||
await page.mutantView.clickOnCode(); | ||
await drawer.whenClosed(); | ||
}); | ||
|
||
test('should not hide the drawer when the user clicks somewhere on the drawer', async () => { | ||
await drawer.whenHalfOpen(); | ||
await drawer.clickOnHeader(); | ||
|
||
await drawer.whenHalfOpen(); | ||
}); | ||
|
||
test.describe('when "read more" is toggled', () => { | ||
test.beforeEach(async () => { | ||
await drawer.whenHalfOpen(); | ||
await drawer.toggleReadMore(); | ||
await drawer.whenOpen(); | ||
}); | ||
|
||
test('should show the details', async () => { | ||
await expect(drawer.details()).toBeVisible(); | ||
}); | ||
|
||
test('should look as expected', async ({ page: p }, testInfo) => { | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
|
||
test('should look as expected in dark mode', async ({ page: p }, testInfo) => { | ||
await page.themeSelector.select('dark'); | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
}); | ||
}); | ||
}); |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import type { Drawer } from './po/Drawer.po.js'; | ||
import { ReportPage } from './po/ReportPage.js'; | ||
import { actScreenshotMatch } from './lib/helpers.js'; | ||
import type { TestDot } from './po/TestDot.po.js'; | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test.describe('Drawer test view', () => { | ||
let page: ReportPage; | ||
let drawer: Drawer; | ||
let dot: TestDot; | ||
|
||
test.beforeEach(async ({ page: p }) => { | ||
page = new ReportPage(p); | ||
await page.navigateTo('lighthouse-example/#test/metrics/interactive-test.js'); | ||
dot = page.testView.testDot(597); | ||
await dot.toggle(); | ||
drawer = page.testView.testDrawer; | ||
await page.testView.scrollToCode(); | ||
}); | ||
|
||
test('should show a summary in the drawer when a test is selected', async () => { | ||
await drawer.whenHalfOpen(); | ||
await expect(drawer.header).toHaveText('✅ Performance: interactive audit should compute interactive [Killing] (22:4)'); | ||
}); | ||
|
||
test('should look as expected', async ({ page: p }, testInfo) => { | ||
await drawer.whenHalfOpen(); | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
|
||
test('should look as expected in dark mode', async ({ page: p }, testInfo) => { | ||
await page.themeSelector.select('dark'); | ||
await drawer.whenHalfOpen(); | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
|
||
test('should hide the drawer when the user clicks somewhere else', async () => { | ||
await page.testView.clickOnCode(); | ||
await drawer.whenClosed(); | ||
await expect(drawer.details()).not.toBeVisible(); | ||
}); | ||
|
||
test('should not hide the drawer when the user clicks somewhere on the drawer', async () => { | ||
await drawer.whenHalfOpen(); | ||
await drawer.clickOnHeader(); | ||
|
||
await drawer.whenHalfOpen(); | ||
}); | ||
|
||
test.describe('when "read more" is toggled', () => { | ||
test.beforeEach(async () => { | ||
await drawer.whenHalfOpen(); | ||
await drawer.toggleReadMore(); | ||
await drawer.whenOpen(); | ||
}); | ||
|
||
test('should show the details', async () => { | ||
await expect(drawer.details()).toBeVisible(); | ||
}); | ||
|
||
test('should look as expected', async ({ page: p }, testInfo) => { | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
|
||
test('should look as expected in dark mode', async ({ page: p }, testInfo) => { | ||
await page.themeSelector.select('dark'); | ||
await actScreenshotMatch(p, testInfo); | ||
}); | ||
}); | ||
}); |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Oops, something went wrong.