Skip to content
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

Changed the minimum count of dummy data (folders and notes) #1649

Merged

Conversation

rayou
Copy link
Contributor

@rayou rayou commented Mar 9, 2018

Fix #1562

At least two dummy folders/notes are required for reordering folders and moving notes in the test. Current dummy data implementation might result in generate only one folder / note.

Please see code below.

TestDummy.js

var folderCount = Math.floor((Math.random() * 5)) + 1
/* ... */
var noteCount = Math.floor((Math.random() * 15)) + 1

However, following tests access to the second item in the folders/notes array.

reorderFolder-test.js

  const secondFolderKey = t.context.storage.json.folders[1].key

moveNote-test.js

  const note2 = t.context.storage1.notes[1]

Increased the minimum count to 2 resolve the issue.

@Rokt33r
Copy link
Member

Rokt33r commented Mar 9, 2018

Wow, I didn't notice there are usages of Math.random. I think this is a bad practice when testing. We should pull out them somewhen.

Anyway, great work!

@Rokt33r Rokt33r merged commit 1226267 into BoostIO:master Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix test
2 participants