You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
945 B

import { Application } from 'spectron'
import electronPath from 'electron'
import path from 'path'
jest.unmock('electron')
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000
8 years ago
describe('main window', function spec() {
beforeEach(() => {
8 years ago
this.app = new Application({
path: electronPath,
args: [path.join(__dirname, '..', '..', 'app')]
})
8 years ago
return this.app.start()
})
8 years ago
afterEach(() => {
if (this.app && this.app.isRunning()) {
return this.app.stop()
}
})
8 years ago
it('should open window', async () => {
const { client, browserWindow } = this.app
8 years ago
await client.waitUntilWindowLoaded()
const title = await browserWindow.getTitle()
expect(title).toBe('Zap')
})
8 years ago
it("should haven't any logs in console of main window", async () => {
const { client } = this.app
await client.waitUntilWindowLoaded()
const logs = await client.getRenderProcessLogs()
expect(logs).toHaveLength(0)
})
})