-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from hyphacoop/validate-blocklist
Add validation to blocklists, test that adding doesn't break stuff
- Loading branch information
Showing
2 changed files
with
40 additions
and
8 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 |
---|---|---|
|
@@ -44,6 +44,17 @@ test('AccountListStore - list patterns', async t => { | |
t.deepEqual(accounts, ['@[email protected]'], 'Only @[email protected] should remain after removal of @[email protected]') | ||
}) | ||
|
||
test("AccountListStore - adding doesn't replace existing", async t => { | ||
const store = newAccountListStore() | ||
const patterns = ['@[email protected]', '@[email protected]'] | ||
const otherPatterns = ['@[email protected]', '@[email protected]'] | ||
await store.add(patterns) | ||
await store.add(otherPatterns) | ||
|
||
const accounts = await store.list() | ||
t.deepEqual(accounts.sort(), patterns.concat(otherPatterns).sort(), 'All patterns should be listed after addition') | ||
}) | ||
|
||
test('AccountListStore - match all wildcard', async t => { | ||
const store = newAccountListStore() | ||
const patterns = ['@*@*'] | ||
|