Skip to content

Commit

Permalink
Disables flaky debouncing test (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncordon authored Dec 23, 2024
1 parent b0e419e commit 8379593
Showing 1 changed file with 37 additions and 32 deletions.
69 changes: 37 additions & 32 deletions packages/react-codemirror/src/e2e_tests/debounce.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,48 @@ test.fail(
},
);

test('onExecute updates should override debounce updates', async ({
mount,
page,
}) => {
const editorPage = new CypherEditorPage(page);
let value = '';
// TODO Fix this test
test.fixme(
'onExecute updates should override debounce updates',
async ({ mount, page }) => {
const editorPage = new CypherEditorPage(page);
let value = '';

const onExecute = () => {
value = '';
void component.update(
<CypherEditor value={value} onChange={onChange} onExecute={onExecute} />,
);
};
const onExecute = () => {
value = '';
void component.update(
<CypherEditor
value={value}
onChange={onChange}
onExecute={onExecute}
/>,
);
};

const onChange = (val: string) => {
value = val;
void component.update(
<CypherEditor value={val} onChange={onChange} onExecute={onExecute} />,
);
};
const onChange = (val: string) => {
value = val;
void component.update(
<CypherEditor value={val} onChange={onChange} onExecute={onExecute} />,
);
};

const component = await mount(
<CypherEditor value={value} onChange={onChange} onExecute={onExecute} />,
);
const component = await mount(
<CypherEditor value={value} onChange={onChange} onExecute={onExecute} />,
);

await editorPage.getEditor().pressSequentially('RETURN 1');
await editorPage.getEditor().press('Enter');
await page.waitForTimeout(DEBOUNCE_TIME_WITH_MARGIN);
await expect(component).not.toContainText('RETURN 1');
await editorPage.getEditor().pressSequentially('RETURN 1');
await editorPage.getEditor().press('Enter');
await page.waitForTimeout(DEBOUNCE_TIME_WITH_MARGIN);
await expect(component).not.toContainText('RETURN 1');

await editorPage.getEditor().pressSequentially('RETURN 1');
await editorPage.getEditor().pressSequentially('');
await editorPage.getEditor().pressSequentially('RETURN 1');
await editorPage.getEditor().press('Enter');
await page.waitForTimeout(DEBOUNCE_TIME_WITH_MARGIN);
await expect(component).not.toContainText('RETURN 1');
});
await editorPage.getEditor().pressSequentially('RETURN 1');
await editorPage.getEditor().pressSequentially('');
await editorPage.getEditor().pressSequentially('RETURN 1');
await editorPage.getEditor().press('Enter');
await page.waitForTimeout(DEBOUNCE_TIME_WITH_MARGIN);
await expect(component).not.toContainText('RETURN 1');
},
);

test('onExecute should fire after debounced updates', async ({
mount,
Expand Down

0 comments on commit 8379593

Please sign in to comment.