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' '# 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 // // Put the cursor in the middle of the list
toggleList(ListType.CheckList)(editor); // editor.dispatch({ selection: EditorSelection.cursor(preSubListText.length) });
const expectedChecklistPart =
'# List test\n - [ ] This\n - [ ] is\n - [ ] a\n - [ ] test\n - [ ] of list toggling';
expect(editor.state.doc.toString()).toBe(
expectedChecklistPart
);
editor.dispatch({ selection: EditorSelection.cursor(editor.state.doc.length) }); // // Sublists should be changed
editor.dispatch(editor.state.replaceSelection('\n\n\n')); // 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. // editor.dispatch({ selection: EditorSelection.cursor(editor.state.doc.length) });
toggleList(ListType.OrderedList)(editor); // editor.dispatch(editor.state.replaceSelection('\n\n\n'));
editor.dispatch(editor.state.replaceSelection('Test.\n2. Test2\n3. Test3'));
expect(editor.state.doc.toString()).toBe( // // toggleList should also create a new list if the cursor is on an empty line.
`${expectedChecklistPart}\n\n\n1. Test.\n2. Test2\n3. Test3` // toggleList(ListType.OrderedList)(editor);
); // editor.dispatch(editor.state.replaceSelection('Test.\n2. Test2\n3. Test3'));
toggleList(ListType.CheckList)(editor); // expect(editor.state.doc.toString()).toBe(
expect(editor.state.doc.toString()).toBe( // `${expectedChecklistPart}\n\n\n1. Test.\n2. Test2\n3. Test3`
`${expectedChecklistPart}\n\n\n- [ ] Test.\n- [ ] Test2\n- [ ] Test3` // );
);
// The entire checklist should have been selected (and thus will now be indented) // toggleList(ListType.CheckList)(editor);
increaseIndent(editor); // expect(editor.state.doc.toString()).toBe(
expect(editor.state.doc.toString()).toBe( // `${expectedChecklistPart}\n\n\n- [ ] Test.\n- [ ] Test2\n- [ ] Test3`
`${expectedChecklistPart}\n\n\n\t- [ ] Test.\n\t- [ ] Test2\n\t- [ ] 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', () => { it('should toggle a numbered list without changing its sublists', () => {