summaryrefslogtreecommitdiffhomepage
path: root/gui/test/unit/setup
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2023-04-13 08:54:33 +0200
committerOskar Nyberg <oskar@mullvad.net>2023-04-17 14:14:07 +0200
commit025a88ecd26d85a1ab8fcedf421ce774de361a0a (patch)
treede09b510dda4dd2d3e8af109bf1526f8955b2362 /gui/test/unit/setup
parentb35de85a68911563cef44e7ae4435187ad425f48 (diff)
downloadmullvadvpn-025a88ecd26d85a1ab8fcedf421ce774de361a0a.tar.xz
mullvadvpn-025a88ecd26d85a1ab8fcedf421ce774de361a0a.zip
Move changelog tests out of setup directory
Diffstat (limited to 'gui/test/unit/setup')
-rw-r--r--gui/test/unit/setup/changelog.spec.ts65
1 files changed, 0 insertions, 65 deletions
diff --git a/gui/test/unit/setup/changelog.spec.ts b/gui/test/unit/setup/changelog.spec.ts
deleted file mode 100644
index 912a8a3397..0000000000
--- a/gui/test/unit/setup/changelog.spec.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { expect } from 'chai';
-import { after, it, describe } from 'mocha';
-import { parseChangelog } from '../../../src/main/changelog';
-
-// It should be handled the same no matter if the platforms are split with a space or not.
-const changelogItems = [
- 'Changelog item 1',
- '[Windows] Changelog item 2',
- '[macOS] Changelog item 3',
- '[linux] Changelog item 4',
- '[Windows, macOS] Changelog item 5',
- '[Windows,linux] Changelog item 6',
- '[Windows, macOS,linux] Changelog item 7',
-];
-
-const changelogString = changelogItems.join('\n');
-
-const mockPlatform = (platform: string) => {
- Object.defineProperty(process, 'platform', { value: platform });
-};
-
-describe('Changelog parser', () => {
- const platform = process.platform;
-
- after(() => {
- mockPlatform(platform);
- });
-
- it('should show Windows items', () => {
- mockPlatform('win32');
-
- const changelog = parseChangelog(changelogString);
-
- expect(changelog).to.have.length(5);
- expect(changelogItems[0].endsWith(changelog[0])).to.be.true;
- expect(changelogItems[1].endsWith(changelog[1])).to.be.true;
- expect(changelogItems[4].endsWith(changelog[2])).to.be.true;
- expect(changelogItems[5].endsWith(changelog[3])).to.be.true;
- expect(changelogItems[6].endsWith(changelog[4])).to.be.true;
- });
-
- it('should show macOS items', () => {
- mockPlatform('darwin');
-
- const changelog = parseChangelog(changelogString);
-
- expect(changelog).to.have.length(4);
- expect(changelogItems[0].endsWith(changelog[0])).to.be.true;
- expect(changelogItems[2].endsWith(changelog[1])).to.be.true;
- expect(changelogItems[4].endsWith(changelog[2])).to.be.true;
- expect(changelogItems[6].endsWith(changelog[3])).to.be.true;
- });
-
- it('should show Linux items', () => {
- mockPlatform('linux');
-
- const changelog = parseChangelog(changelogString);
-
- expect(changelog).to.have.length(4);
- expect(changelogItems[0].endsWith(changelog[0])).to.be.true;
- expect(changelogItems[3].endsWith(changelog[1])).to.be.true;
- expect(changelogItems[5].endsWith(changelog[2])).to.be.true;
- expect(changelogItems[6].endsWith(changelog[3])).to.be.true;
- });
-});