`no-self-reference` - Fix false positives on AJAX navigation by scarf005 · Pull Request #9078 · refined-github/refined-github · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions source/features/no-self-reference.tsx
20 changes: 20 additions & 0 deletions source/helpers/is-current-page-link.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {test, assert} from 'vitest';

import isCurrentPageLink from './is-current-page-link.js';

test('isCurrentPageLink', () => {
location.href = 'https://github.com/refined-github/refined-github/issues/9077#issuecomment-1';

const selfLink = {
href: 'https://github.com/refined-github/refined-github/issues/9077#issuecomment-2',
};
assert.isTrue(isCurrentPageLink(selfLink));

@SunsetTechuila SunsetTechuila Mar 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should return false


location.href = 'https://github.com/refined-github/refined-github/issues/9078';
assert.isFalse(isCurrentPageLink(selfLink));

const otherLink = {
href: 'https://github.com/refined-github/refined-github/issues/9078',
};
assert.isTrue(isCurrentPageLink(otherLink));
});
8 changes: 8 additions & 0 deletions source/helpers/is-current-page-link.ts
Loading