feat: open repo secrets page in addition to README (#5684)

This commit is contained in:
Lee James
2025-08-07 12:00:46 -04:00
committed by GitHub
parent 6ae75c9f32
commit 8d848dca4a
6 changed files with 158 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ import {
isAtCommand,
isSlashCommand,
copyToClipboard,
getUrlOpenCommand,
} from './commandUtils.js';
// Mock child_process
@@ -342,4 +343,42 @@ describe('commandUtils', () => {
});
});
});
describe('getUrlOpenCommand', () => {
describe('on macOS (darwin)', () => {
beforeEach(() => {
mockProcess.platform = 'darwin';
});
it('should return open', () => {
expect(getUrlOpenCommand()).toBe('open');
});
});
describe('on Windows (win32)', () => {
beforeEach(() => {
mockProcess.platform = 'win32';
});
it('should return start', () => {
expect(getUrlOpenCommand()).toBe('start');
});
});
describe('on Linux (linux)', () => {
beforeEach(() => {
mockProcess.platform = 'linux';
});
it('should return xdg-open', () => {
expect(getUrlOpenCommand()).toBe('xdg-open');
});
});
describe('on unmatched OS', () => {
beforeEach(() => {
mockProcess.platform = 'unmatched';
});
it('should return xdg-open', () => {
expect(getUrlOpenCommand()).toBe('xdg-open');
});
});
});
});