Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added Tests:
Regression.
A basic regression test on the front. Run
regressionTest()
anywhere ondir.html
to check if the current version is breaking decryption of older files.For now, I'm just logging asuccess
message when the decrypted blob's content equals the expected value of an encrypted control file (regression-control.txt).Had to refactor
dir.js
andcipher.js
a tiny bit. Also,.gitignore
is now 'unignoring' the folder holding the test's control file (cc8).Edit: I also had to add a trigger on
handleFileDownload()
to simulate a click on the listed test file. I know this is not ideal (test harnessing?), but this is the only way I could think of to go through every step (function call) a user would go on a traditional upload-encrypt-decrypt-download use case cycle.Update (May. 04):
Error on fail.Update feedback.Now the regression test throws and error on fail
instead of logging a message when it succeedsand a success message when it succeeds.Fix page reload.
We need to force reload the page in order to support consecutive tests, since the page won't refresh itself when the URL's path is not updated (in this case,
/dir/data/cc8/tluICx+fpoDNb+DsLMquWl+aai5sVg
). After the first test (from whatever secret folder ondir.html
), only the URL's hash is updated (with the test file's key), hence the need to force a page reload.I also had to set a delay for the page reload, since it seems that without it the page is reloaded before the URL is updated (which is kinda weird to me, I assumed a synchronous sequence of operations was happening here).
API tests.
We now have tests for the following operations:
GET /mkdir
.POST /secret/folder
.GET /ls
.DELETE /secret/folder/file
.Notes:
api.js
).regression-control.txt
).regression-control.txt
(which we get after the Upload File operation).