fix(release): harden cross-platform gates

This commit is contained in:
NimBold
2026-06-23 21:43:11 +03:30
parent f603b74a99
commit 82ed38d55a
6 changed files with 31 additions and 8 deletions
+2 -2
View File
@@ -17,9 +17,9 @@ import {
} from './downloadLocations';
describe('download locations', () => {
it('compares Windows and macOS locations case-insensitively', () => {
it('matches backend platform path case semantics', () => {
expect(downloadLocationEquals('D:\\Downloads', 'Movie.MP4', 'd:/downloads', 'movie.mp4', 'windows')).toBe(true);
expect(downloadLocationEquals('/Users/Test', 'Movie.MP4', '/users/test', 'movie.mp4', 'macos')).toBe(true);
expect(downloadLocationEquals('/Users/Test', 'Movie.MP4', '/users/test', 'movie.mp4', 'macos')).toBe(false);
expect(downloadLocationEquals('/home/Test', 'Movie.MP4', '/home/test', 'movie.mp4', 'linux')).toBe(false);
});
beforeEach(() => {
+1 -1
View File
@@ -153,7 +153,7 @@ export const downloadLocationEquals = (
): boolean => {
const normalize = (value: string) => {
const normalized = value.replace(/\\/g, '/').replace(/\/+$/, '');
return os === 'windows' || os === 'macos'
return os === 'windows'
? normalized.toLocaleLowerCase()
: normalized;
};