Skip to content

Run tests in FF #3772

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

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Build website
run: node --run build:website
- name: Install Playwright Browsers
run: npx playwright install chromium
run: npx playwright install chromium firefox
- name: Test
run: node --run test
timeout-minutes: 4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@typescript-eslint/parser": "^8.32.0",
"@vitejs/plugin-react": "^4.4.1",
"@vitest/browser": "^3.1.3",
"@vitest/coverage-v8": "^3.1.3",
"@vitest/coverage-istanbul": "^3.1.3",
"@vitest/eslint-plugin": "^1.1.44",
"@wyw-in-js/rollup": "^0.6.0",
"@wyw-in-js/vite": "^0.6.0",
Expand Down
11 changes: 6 additions & 5 deletions test/browser/column/renderEditCell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Editor', () => {
await userEvent.keyboard('2');
await userEvent.tab();
await expect.element(editor).not.toBeInTheDocument();
expect(getCellsAtRowIndex(0)[0]).toHaveTextContent(/^12$/);
expect(getCellsAtRowIndex(0)[0]).toHaveTextContent(12);
});

it('should open and commit changes on enter', async () => {
Expand All @@ -42,7 +42,7 @@ describe('Editor', () => {
page.render(<EditorTest />);
await userEvent.click(getCellsAtRowIndex(0)[0]);
await userEvent.keyboard('123{enter}');
expect(getCellsAtRowIndex(0)[0]).toHaveTextContent(/^1123$/);
expect(getCellsAtRowIndex(0)[0]).toHaveTextContent('123');
});

it('should close editor and discard changes on escape', async () => {
Expand Down Expand Up @@ -99,7 +99,8 @@ describe('Editor', () => {
const editor = page.getByRole('spinbutton', { name: 'col1-editor' });
await expect.element(editor).not.toBeInTheDocument();
expect(getGrid().element().scrollTop).toBe(2000);
await userEvent.keyboard('123');
// `1{backspace}` is needed to fix tests in FF
await userEvent.keyboard('1{backspace}123');
expect(getCellsAtRowIndex(0)).toHaveLength(2);
await expect.element(editor).toHaveValue(123);
expect(getGrid().element().scrollTop).toBe(0);
Expand Down Expand Up @@ -193,9 +194,9 @@ describe('Editor', () => {
}}
/>
);
await userEvent.click(getCellsAtRowIndex(0)[1]);
await userEvent.dblClick(getCellsAtRowIndex(0)[1]);
await userEvent.keyboard('yz{enter}');
expect(getCellsAtRowIndex(0)[1]).toHaveTextContent(/^a1yz$/);
expect(getCellsAtRowIndex(0)[1]).toHaveTextContent('yz');
await userEvent.keyboard('x');
await expect
.element(page.getByRole('textbox', { name: 'col2-editor' }))
Expand Down
12 changes: 7 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,16 @@ export default defineConfig(({ command }) => ({
server: {
open: true
},
optimizeDeps: {
include: ['@vitest/coverage-v8/browser']
},
test: {
globals: true,
maxWorkers: 4,
coverage: {
provider: 'v8',
provider: 'istanbul',
enabled: isCI,
include: ['src/**/*.{ts,tsx}'],
reporter: ['json']
},
testTimeout: isCI ? 10000 : 5000,
testTimeout: 20_000,
restoreMocks: true,
sequence: {
shuffle: true
Expand All @@ -102,6 +100,10 @@ export default defineConfig(({ command }) => ({
{
browser: 'chromium',
context: { viewport }
},
{
browser: 'firefox',
context: { viewport }
}
],
commands: { resizeColumn, dragFill },
Expand Down
Loading