Support for joining New Groups via invite links

This commit is contained in:
Scott Nonnenberg 2021-01-29 14:16:48 -08:00 committed by GitHub
parent c0510b08a5
commit a48b3e381e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 2532 additions and 381 deletions

View file

@ -100,11 +100,12 @@ describe('sgnlHref', () => {
'sgnl://foo?',
'SGNL://foo?',
'sgnl://user:pass@foo',
'sgnl://foo/path/data#hash-data',
'sgnl://foo/path/data',
].forEach(href => {
assert.deepEqual(parseSgnlHref(href, explodingLogger), {
command: 'foo',
args: new Map<string, string>(),
hash: undefined,
});
});
});
@ -124,6 +125,7 @@ describe('sgnlHref', () => {
['empty', ''],
['encoded', 'hello world'],
]),
hash: undefined,
}
);
});
@ -144,17 +146,30 @@ describe('sgnlHref', () => {
);
});
it('includes hash', () => {
[
'sgnl://foo?bar=baz#somehash',
'sgnl://user:pass@foo?bar=baz#somehash',
].forEach(href => {
assert.deepEqual(parseSgnlHref(href, explodingLogger), {
command: 'foo',
args: new Map([['bar', 'baz']]),
hash: 'somehash',
});
});
});
it('ignores other parts of the URL', () => {
[
'sgnl://foo?bar=baz',
'sgnl://foo/?bar=baz',
'sgnl://foo/lots/of/path?bar=baz',
'sgnl://foo?bar=baz#hash',
'sgnl://user:pass@foo?bar=baz',
].forEach(href => {
assert.deepEqual(parseSgnlHref(href, explodingLogger), {
command: 'foo',
args: new Map([['bar', 'baz']]),
hash: undefined,
});
});
});