This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make application testable by adding success message element to DOM that is hidden when page loads but becomes visible when XHR upload to bucket finishes. Add automated test that uses Puppeteer to select a test file (stored in this repo under test/1x1.png) and click the upload button to upload it. The test is considered successful as long as the XHR for the file upload succeeds. Added GitHub Actions workflow that occasionally clears out the contents of the bucket which was created only for this automated test.
- Loading branch information
Showing
14 changed files
with
4,582 additions
and
1,366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow periodically empties out the B2 bucket used for the automated | ||
# test. Each time the test runs, a file revision is uploaded to the bucket, so | ||
# I need to clear the revisions out once in a while. Here, it happens every | ||
# month. | ||
|
||
name: Empty test bucket | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 1 * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: Empty bucket | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo "Downloading B2 CLI..." | ||
wget -q https://github.com/Backblaze/B2_Command_Line_Tool/releases/latest/download/b2-linux | ||
mv b2-linux b2 | ||
chmod +x b2 | ||
echo "Done." | ||
echo "Authenticating CLI..." | ||
./b2 authorize_account $B2_KEY_ID $B2_APPLICATION_KEY | ||
echo "Done." | ||
echo "Emptying test bucket contents..." | ||
./b2 rm --versions --recursive $B2_BUCKET_NAME | ||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node_modules | ||
.vscode | ||
dist | ||
dist | ||
run_tests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Program", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | ||
"args": [ "${workspaceFolder}/test/index.spec.js" ] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.