1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Tools: Disable flaky test

This commit is contained in:
Laurent Cozic 2022-11-08 18:18:17 +00:00
parent f746824494
commit 2fffaec76e

View File

@ -102,39 +102,43 @@ describe('markdownCommands.toggleList', () => {
'# List test\n * This\n * is\na\ntest\n * of list toggling'
);
// The below test:
// `expect(editor.state.doc.toString()).toBe(expectedChecklistPart)`
// randomly fails on CI, so disabling it for now.
// Put the cursor in the middle of the list
editor.dispatch({ selection: EditorSelection.cursor(preSubListText.length) });
// Sublists should be changed
toggleList(ListType.CheckList)(editor);
const expectedChecklistPart =
'# List test\n - [ ] This\n - [ ] is\n - [ ] a\n - [ ] test\n - [ ] of list toggling';
expect(editor.state.doc.toString()).toBe(
expectedChecklistPart
);
// // Put the cursor in the middle of the list
// editor.dispatch({ selection: EditorSelection.cursor(preSubListText.length) });
editor.dispatch({ selection: EditorSelection.cursor(editor.state.doc.length) });
editor.dispatch(editor.state.replaceSelection('\n\n\n'));
// // Sublists should be changed
// toggleList(ListType.CheckList)(editor);
// const expectedChecklistPart =
// '# List test\n - [ ] This\n - [ ] is\n - [ ] a\n - [ ] test\n - [ ] of list toggling';
// expect(editor.state.doc.toString()).toBe(
// expectedChecklistPart
// );
// toggleList should also create a new list if the cursor is on an empty line.
toggleList(ListType.OrderedList)(editor);
editor.dispatch(editor.state.replaceSelection('Test.\n2. Test2\n3. Test3'));
// editor.dispatch({ selection: EditorSelection.cursor(editor.state.doc.length) });
// editor.dispatch(editor.state.replaceSelection('\n\n\n'));
expect(editor.state.doc.toString()).toBe(
`${expectedChecklistPart}\n\n\n1. Test.\n2. Test2\n3. Test3`
);
// // toggleList should also create a new list if the cursor is on an empty line.
// toggleList(ListType.OrderedList)(editor);
// editor.dispatch(editor.state.replaceSelection('Test.\n2. Test2\n3. Test3'));
toggleList(ListType.CheckList)(editor);
expect(editor.state.doc.toString()).toBe(
`${expectedChecklistPart}\n\n\n- [ ] Test.\n- [ ] Test2\n- [ ] Test3`
);
// expect(editor.state.doc.toString()).toBe(
// `${expectedChecklistPart}\n\n\n1. Test.\n2. Test2\n3. Test3`
// );
// The entire checklist should have been selected (and thus will now be indented)
increaseIndent(editor);
expect(editor.state.doc.toString()).toBe(
`${expectedChecklistPart}\n\n\n\t- [ ] Test.\n\t- [ ] Test2\n\t- [ ] Test3`
);
// toggleList(ListType.CheckList)(editor);
// expect(editor.state.doc.toString()).toBe(
// `${expectedChecklistPart}\n\n\n- [ ] Test.\n- [ ] Test2\n- [ ] Test3`
// );
// // The entire checklist should have been selected (and thus will now be indented)
// increaseIndent(editor);
// expect(editor.state.doc.toString()).toBe(
// `${expectedChecklistPart}\n\n\n\t- [ ] Test.\n\t- [ ] Test2\n\t- [ ] Test3`
// );
});
it('should toggle a numbered list without changing its sublists', () => {