Skip to content

Commit

Permalink
fix broken desktop unit tests on menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
jon gadsden committed Nov 6, 2023
1 parent a6416ab commit c6cea8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ BASE_URL
# ignore references to releases in template
github.com/OWASP/threat-dragon/releases/
github.com/OWASP/threat-dragon/archive/

# ignore LINDDUN site because it occasionally times out
https://www.linddun.org/
6 changes: 3 additions & 3 deletions td.vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"start:desktop": "vue-cli-service electron:serve",
"start:serve": "pm2 --name td.vue start 'vue-cli-service serve'",
"stop:serve": "pm2 delete td.vue",
"test": "vue-cli-service test:unit",
"test:desktop": "vue-cli-service test:unit --testMatch '**/unit/desktop/**/*.spec.js' --collectCoverageFrom='src/desktop/**/*.js'",
"test": "vue-cli-service test:unit --testPathIgnorePatterns tests/unit/desktop/",
"test:desktop": "vue-cli-service test:unit --testMatch '**/unit/desktop/**/*.spec.js' --collectCoverageFrom 'src/desktop/**/*.js'",
"test:e2e": "vue-cli-service test:e2e -C e2e.local.config.js",
"test:e2e:desktop": "wdio run ./wdio.config.js",
"test:e2e:local": "vue-cli-service test:e2e -C e2e.local.config.js --url http://localhost:8080/",
Expand All @@ -26,7 +26,7 @@
"test:e2e-smokes": "browserstack-cypress run --cf browserstack.smokes.json --sync",
"test:e2e-smokes:local": "vue-cli-service test:e2e -C e2e.smokes.local.config.js --url http://localhost:8080/",
"test:e2e-nightly": "browserstack-cypress run --cf browserstack.nightly.json --sync",
"test:unit": "vue-cli-service test:unit",
"test:unit": "vue-cli-service test:unit --testPathIgnorePatterns tests/unit/desktop/",
"test:vue": "vue-cli-service test:e2e -C e2e.local.config.js --headless --browser chrome"
},
"description": "OWASP Threat Dragon - a free, open source threat modeling tool",
Expand Down
8 changes: 6 additions & 2 deletions td.vue/tests/unit/desktop/menu.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('desktop/menu.js', () => {
const fileItems = menu.getMenuTemplate().find((item) => item.label === 'File');

it('contains the Close role', () => {
const closeRole = {'role': 'close'};
const closeRole = {'label': 'Close Window', 'role': 'close'};
expect(fileItems.submenu).toContainEqual(closeRole);
});

Expand All @@ -54,7 +54,11 @@ describe('desktop/menu.js', () => {
});

it('contains recent items', () => {
const recentItems = {'role': 'recentdocuments', 'submenu': [{'role': 'clearrecentdocuments'}]};
const recentItems = {
'label': 'Open Recent',
'role': 'recentdocuments',
'submenu': [{'label': 'Clear Menu', 'role': 'clearrecentdocuments'}]
};
expect(fileItems.submenu).toContainEqual(recentItems);
});

Expand Down

0 comments on commit c6cea8c

Please sign in to comment.