Skip to content

Commit

Permalink
Revert "Tests: Fix random failures (#2777)"
Browse files Browse the repository at this point in the history
This reverts commit d1cab4b.
Part of this revert: d2582f4

For rationale see #2819 (comment)
  • Loading branch information
laurent22 committed May 2, 2020
1 parent cb8dca7 commit ec8ccc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 143 deletions.
129 changes: 0 additions & 129 deletions CliClient/tests/feature_ForwardBackwardNoteHistory.js

This file was deleted.

26 changes: 12 additions & 14 deletions CliClient/tests/feature_ShowAllNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ describe('integration_ShowAllNotes', function() {
const folder2 = await Folder.save({ title: 'folder2' });
const note1 = await Note.save({ title: 'note1', parent_id: folder1.id });
const note2 = await Note.save({ title: 'note2', parent_id: folder2.id });
await testApp.wait();
testApp.dispatch({ type: 'FOLDER_SELECT', id: folder1.id }); // active folder
await testApp.wait();
await time.msleep(100);
testApp.dispatch({ type: 'NOTE_SELECT', id: note1.id });
await testApp.wait();
await time.msleep(100);
testApp.dispatch({ type: 'SMART_FILTER_SELECT', id: ALL_NOTES_FILTER_ID });
await testApp.wait();
await time.msleep(100);

// check the state is set up as expected
let state = testApp.store().getState();
Expand All @@ -110,7 +109,7 @@ describe('integration_ShowAllNotes', function() {

// TEST ACTION: duplicate a note from the active folder
const newNote1 = await Note.duplicate(note1.id);
await testApp.wait();
await time.msleep(100);

// check the note is duplicated and the view updated
state = testApp.store().getState();
Expand All @@ -119,7 +118,7 @@ describe('integration_ShowAllNotes', function() {

// TEST ACTION: duplicate a note from a non-active folder
const newNote2 = await Note.duplicate(note2.id);
await testApp.wait();
await time.msleep(100);

// check the note is duplicated and the view updated
state = testApp.store().getState();
Expand All @@ -133,13 +132,12 @@ describe('integration_ShowAllNotes', function() {
const folder2 = await Folder.save({ title: 'folder2' });
const note1 = await Note.save({ title: 'note1', parent_id: folder1.id });
const note2 = await Note.save({ title: 'note1', parent_id: folder2.id });
await testApp.wait();
testApp.dispatch({ type: 'FOLDER_SELECT', id: folder1.id }); // active folder
await testApp.wait();
await time.msleep(100);
testApp.dispatch({ type: 'NOTE_SELECT', id: note1.id });
await testApp.wait();
await time.msleep(100);
testApp.dispatch({ type: 'SMART_FILTER_SELECT', id: ALL_NOTES_FILTER_ID });
await testApp.wait();
await time.msleep(100);

// check the state is set up as expected
let state = testApp.store().getState();
Expand All @@ -149,19 +147,19 @@ describe('integration_ShowAllNotes', function() {

// TEST ACTION: change the notes parent
await Note.moveToFolder(note1.id, folder2.id);
await testApp.wait();
await time.msleep(100);

// check the note is updated and remains in view
// check the note is duplicated and the view updated
state = testApp.store().getState();
expect(state.notes.length).toEqual(2);
let n1 = await Note.load(note1.id);
expect(n1.parent_id).toEqual(folder2.id);

// TEST ACTION: change the notes parent
await Note.moveToFolder(note1.id, folder1.id);
await testApp.wait();
await time.msleep(100);

// check the note is updated and remains in view
// check the note is duplicated and the view updated
state = testApp.store().getState();
expect(state.notes.length).toEqual(2);
n1 = await Note.load(note1.id);
Expand Down

0 comments on commit ec8ccc9

Please sign in to comment.