Commit 46b48638 authored by Hannah Stepanek's avatar Hannah Stepanek

Add uri null handling into isScopedToUri logic

In cases like: https://hypothes.is/a/rGSnNwCKSuiG3VT__k3VvA where the
sidebar is not being used, the document uri is set to null in the groups
service and passed to the combineGroups function. This means that the
isScopedToUri logic must handle the case where uri=null.
parent f18182dc
......@@ -129,6 +129,12 @@ describe('sidebar.util.groups', () => {
isScopedToUri: false,
uri: 'https://foo.com/bar',
},
{
description: 'sets `isScopedToUri` to true if `uri` is null',
scopes: { enforced: true, uri_patterns: ['http://foo.com*'] },
isScopedToUri: true,
uri: null,
},
{
description: 'it permits multiple *s in the scopes uri pattern',
scopes: { enforced: true, uri_patterns: ['https://foo.com*bar*'] },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment