Skip to content
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

fix(ui-mode): Watch mode button doesn't show active when test selected #34581

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/web/src/components/treeView.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
color: var(--vscode-list-activeSelectionForeground) !important;
}

.tree-view-content:focus .tree-view-entry.selected button.eye.toggled .codicon {
color: var(--vscode-editorInfo-foreground) !important;
}

.tree-view-empty {
flex: auto;
display: flex;
Expand Down
22 changes: 22 additions & 0 deletions tests/playwright-test/ui-mode-test-watch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,25 @@ test('should not watch output', async ({ runUITest }) => {
expect(commands).toContain('runTests');
expect(commands).not.toContain('listTests');
});


test('should have watch icon highlighted when a test is focused and watch on the test is enabled', async ({ runUITest, writeFiles }) => {
const { page } = await runUITest({
'a.test.ts': `
import { test, expect } from '@playwright/test';
test('passes', () => {});
`,
});

await page.getByText('a.test.ts').click();
// watch icon should not be highlight till the watch icon is clicked
await expect(page.getByRole('treeitem', { name: 'a.test.ts' }).getByRole('button', { name: 'Watch' })).toHaveCSS('color', 'rgb(255, 255, 255)');

await page.getByRole('treeitem', { name: 'passes' }).hover();
await page.getByRole('treeitem', { name: 'passes' }).getByRole('button', { name: 'Watch' }).click();
await expect(page.getByRole('treeitem', { name: 'passes' }).getByRole('button', { name: 'Watch' }).locator('.codicon-eye')).toHaveCSS('color', 'rgb(26, 133, 255)');
await expect.poll(dumpTestTree(page)).toBe(`
▼ ◯ a.test.ts
◯ passes 👁 <=
`);
});
Loading