-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
final changes to tests before release.
- Loading branch information
Matthew Mulholland
committed
Feb 28, 2018
1 parent
474b430
commit 8689133
Showing
13 changed files
with
114 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,5 @@ | |
] | ||
} | ||
}, | ||
"plugins": ["transform-runtime"], | ||
"sourceMaps": "inline" | ||
"plugins": ["transform-runtime"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
import { expect, should, assert } from 'chai' | ||
import { Given, When, Then, After, Before} from 'cucumber' | ||
import fakeMenu from 'spectron-fake-menu' | ||
import {fileFormats} from '../../../../src/renderer/file-formats.js' | ||
const _ = require('lodash') | ||
|
||
Before({timeout: 10000}, function () { | ||
fakeMenu.apply(this.app) | ||
this.fakeMenu = fakeMenu | ||
When(/^I click on the "([\w]+?)"->"([\w]+?)" menu/, async function (menuLabel, subMenuLabel) { | ||
let returned = await this.app.electron.ipcRenderer.sendSync('clickLabelsOnMenu', [menuLabel, subMenuLabel]) | ||
expect(returned).to.equal(subMenuLabel) | ||
}) | ||
|
||
When(/^I click on the ([\w]+?) menu/, function (menuLabel) { | ||
return this.app | ||
.client.waitUntilWindowLoaded() | ||
.getWindowCount().should.eventually.have.at.least(1) | ||
.electron | ||
.Menu | ||
.getApplicationMenu() | ||
.then(function(menu) { | ||
console.log('entered menu') | ||
// let menu1 = getMenuFromLabel(menu, menuLabel) | ||
// let submenu = getSubMenuFromMenu(menu1, subMenuLabels) | ||
// submenu.click() | ||
}) | ||
// 3rd menu may contain spaces, dots | ||
When(/^I click on the "([\w]+?)"->"([\w]+?)"->"([\w \.]+?)" menu/, async function (menuLabel, subMenuLabel, subSubMenuLabel) { | ||
let returned = await this.app.electron.ipcRenderer.sendSync('clickLabelsOnMenu', [menuLabel, subMenuLabel, subSubMenuLabel]) | ||
expect(returned).to.equal(subSubMenuLabel) | ||
}) | ||
|
||
function getMenuFromLabel(menu, menuLabel) { | ||
return menu.items.find(function(x) { x.label === menuLabel }) | ||
} | ||
Then('I should see the openfile dialog', async function () { | ||
let globalNames = await this.app | ||
.electron | ||
.remote | ||
.getGlobal('openFileDialogReturned') | ||
console.log(globalNames) | ||
expect(globalNames).to.deep.equal(this.openFileDialogReturned) | ||
}) | ||
|
||
function getSubMenuFromMenu(menu, subMenuLabel) { | ||
return menu.submenu.items.find(function(x) { x.label === subMenuLabel }) | ||
} | ||
Then('another tab is opened with its filename as the title', async function () { | ||
let filePath = require('path').join(__dirname, '../../../fixtures/valid.csv') | ||
await this.app.electron.ipcRenderer.send('openFileIntoTab', filePath, fileFormats.csv) | ||
let text = await this.app.client | ||
.timeouts('implicit', 3000) | ||
.getText('#tab1') | ||
expect(text).to.equal('valid') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters