+ describe('_profileControlsTopic', function () {
+ let profileUrlObj, topicUrlObj;
+ it('allows exact match', function () {
+ profileUrlObj = new URL('https://profile.example.com/');
+ topicUrlObj = new URL('https://profile.example.com/');
+ const result = Manager._profileControlsTopic(profileUrlObj, topicUrlObj);
+ assert.strictEqual(result, true);
+ });
+ it('allows descendent-path match', function () {
+ profileUrlObj = new URL('https://profile.example.com/');
+ topicUrlObj = new URL('https://profile.example.com/feed/atom');
+ const result = Manager._profileControlsTopic(profileUrlObj, topicUrlObj);
+ assert.strictEqual(result, true);
+ });
+ it('disallows non-descendent-path', function () {
+ profileUrlObj = new URL('https://profile.example.com/itsame');
+ topicUrlObj = new URL('https://profile.example.com/');
+ const result = Manager._profileControlsTopic(profileUrlObj, topicUrlObj);
+ assert.strictEqual(result, false);
+ });
+ it('disallows non-matched host', function () {
+ profileUrlObj = new URL('https://profile.example.com/itsame');
+ topicUrlObj = new URL('https://elsewhere.example.com/itsame/feed');
+ const result = Manager._profileControlsTopic(profileUrlObj, topicUrlObj);
+ assert.strictEqual(result, false);
+ });
+ }); // _profileControlsTopic
+