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
6 changes: 6 additions & 0 deletions src/github-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ function toggleUserDropdown() {
const dropdown = document.createElement('div');
dropdown.className = 'user-dropdown absolute right-0 top-full mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50';
dropdown.innerHTML = `
<a href="https://github.com/settings/installations" target="_blank" rel="noopener noreferrer"
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center space-x-2">
<i class="fas fa-key text-xs"></i>
<span>Manage GitHub access</span>
</a>
<div class="border-t border-gray-100 my-1"></div>
<button class="w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center space-x-2">
<i class="fas fa-sign-out-alt text-xs"></i>
<span>Sign out</span>
Expand Down
9 changes: 9 additions & 0 deletions tests/github-auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ describe('GitHub Authentication (Clerk-only)', () => {
expect(container.querySelector('.user-dropdown')).toBeNull();
});

test('includes a link to manage the GitHub App repository access', () => {
window.GitHubAuth.toggleUserDropdown();

const link = container.querySelector('.user-dropdown a[href="https://github.com/settings/installations"]');
expect(link).not.toBeNull();
expect(link.getAttribute('target')).toBe('_blank');
expect(link.textContent).toContain('Manage GitHub access');
});

test('Sign out triggers Clerk sign-out', () => {
window.ClerkAuth = { signOut: jest.fn() };
window.GitHubAuth.toggleUserDropdown();
Expand Down
Loading