To create a safe environment for dummy data, start Patchwork with a custom ssb_appname environment variable.
The default value is ssb, which causes all data to be stored in ~/.ssb.
You can use arbitrary values (but be careful not to collide with other dot-directories in your home!).
For example:
ssb_appname=test npm start
Will use ~/.test.
When you want to nuke the DB (to start fresh, or when you're done), simply delete the directory:
rm -Rf ~/.test
Your active account is decided by the ~/$DATA-DIRECTORY/secret file.
In default configuration, it's located in ~/.ssb/secret.
In the example above, it is ~/.test/secret.
If Patchwork doesn't find a secret file, it generates a new one, thereby creating a new account.
A simple way to switch accounts, therefore, is to stop Patchwork and:
mv ~/.test/secret ~/.test/$NAME-secret
For example, if your account is named "bob":
mv ~/.test/secret ~/.test/bob-secret
Then restart Patchwork, creating your new account. When you want to restore bob to the main account, you close Patchwork and repeat the steps:
mv ~/.test/secret ~/.test/alice-secret
cp ~/.test/bob-secret ~/.test/secret
cd api
npm test
Follow this procedure before every version bump.
- Test bad inputs
- no name.
- name with spaces, too many periods, unusual characters.
- non-PNG and non-JPG pictures.
- Test with good name and picture:
- Create profile with name and picture.
- Ensure that you are shown the welcome help, and exit it.
- Open profile view, upload another picture.
- Test with good name and no picture:
- Close patchwork, reset, reopen.
- Create profile with name, no picture.
- Open profile view, upload picture.
- Test bad inputs
- no text
- Test good input:
- Open newsfeed.
- Open composer, post a test message.
- Check the message appeared automatically in newsfeed (no refreshing).
- Open the message.
- Reply to the message.
- Check that the reply appeared automatically in thread (no refreshing).
- Check the newsfeed to ensure reply count automatically updated (no refreshing).
- Test bad inputs
- no text.
- Test good input:
- Open inbox.
- Open composer, send a test message to self.
- Check the message appeared automatically in inbox (no refreshing).
- Open the message.
- Reply to the message.
- Check that the reply appeared automatically in thread (no refreshing).
- Check the inbox to ensure reply count automatically updated (no refreshing).
- Dig from newsfeed.
- Open newsfeed.
- Dig a message.
- Check that button state updated, and name was added to message as someone who dug it.
- Open message.
- Check that button state and dug-list is correct.
- Undig from newsfeed.
- Undig the previous message
- Check that button state updated, and name was removed from message's dug-list.
- Open message.
- Check that button state and dug-list is correct.
- Dig from thread.
- Open the message.
- Dig it.
- Check that button state updated, and name was added to message as someone who dug it.
- Open newsfeed.
- Check that button state and dug-list is correct.
- Undig from thread.
- Open the message.
- Undig it.
- Check that button state updated, and name was removed from message's dug-list.
- Open newsfeed.
- Check that button state and dug-list is correct.
- Dig from thread.
- Open the inbox.
- Open an encrypted message.
- Dig it.
- Check that button state updated, and name was added to message as someone who dug it.
- Undig from thread.
- Open the same message.
- Undig it.
- Check that button state updated, and name was removed from message's dug-list.
- Flag from newsfeed.
- Open newsfeed.
- Flag a message.
- Check that the message is now muted, the button state updated, and name was added to message as someone who flagged it.
- Open message.
- Check that button state and flagged-list is correct.
- Unflag from newsfeed.
- Unflag the previous message
- Check that the message is now unmuted, the button state updated, and name was removed from message's flagged-list.
- Open message.
- Check that button state and flagged-list is correct.
- Flag from thread.
- Open the message.
- Flag it.
- Check that button state updated, and name was added to message as someone who flagged it.
- Open newsfeed.
- Check that the message is now muted, the button state and flagged-list is correct.
- Unflag from thread.
- Open the message.
- Unflag it.
- Check that button state updated, and name was removed from message's flagged-list.
- Open newsfeed.
- Check that the message is now unmuted, the button state and flagged-list is correct.
- Flag from thread.
- Open the inbox.
- Open an encrypted message.
- Flag it.
- Check that button state updated, and name was added to message as someone who flagged it.
- Unflag from thread.
- Open the same message.
- Unflag it.
- Check that button state updated, and name was removed from message's flagged-list.
- Pre-test setup:
- Close patchwork, delete the
~/.test/secret, start patchwork - Setup the new test user
- Follow a user
- Open the old test-user in the contacts view.
- Click the follow button.
- Ensure the follow-state has changed, and that you are now listed in the followers of that user.
- Open self profile.
- Ensure the old test-user is now listed in your following section.
- Unfollow a user
- Open the old test-user in the contacts view.
- Click the unfollow button.
- Ensure the follow-state has changed, and that you are now unlisted from the followers of that user.
- Open self profile.
- Ensure the old test-user is now unlisted from your following section.
- Flag a user
- Open the old test-user in the contacts view.
- Click the flag button, and choose any reason.
- Ensure the flag-state has changed, and that you are now listed in the flaggers of that user, with the chosen reason.
- Unflag a user
- Open the old test-user in the contacts view.
- Click the unflag button.
- Ensure the flag-state has changed, and that you are now unlisted from the flaggers of that user.
- Search for a user.
- Open the contacts view
- Enter the old test-user's nickname in the search input
- Ensure the old test-user appears
- Do the same for your current test-user's nickname
- Bad inputs
- Click the Join a Pub btn in the left nav.
- Use each of the following bad codes, ensuring a human-readable error message on each failure:
foo
176.58.117.63:8008:@J+0DGLgRn8H5tVLCcRUfN7NfUcTGEZKqML3krEOJjDY=.ed25519
176.58.117.63:8008:@J+0DGLgRn8H5tVLCcRUfN7NfUcTGEZKqML3krEOJjDY=.ed25519~ehmZ6O8yohSGwISC8iMJjPTlp/Q0EODWi+EYNA+w=
176.58.117.63:8008:@J+0DGLgRn8H5tVLCcRUcN7NfUcTGEZKqML3krEOJjDY=.ed25519~ehmZ6O8yoh6rMSGwISC8iMJjPTlp/Q0EODWi+EYNA+w=
- Using an invite
- Click the Join a Pub btn in the left nav.
- Enter the test-pub's invite.
- Ensure you are taken to the newsfeed and receive new posts.
- Ensure sync status indicators show you are globally-connected.