Skip to content

Commit

Permalink
Merge pull request #878 from hovancik/fix/lint
Browse files Browse the repository at this point in the history
Fix lint messages
  • Loading branch information
hovancik authored Mar 9, 2021
2 parents 1769473 + 3c4af7c commit 26bd543
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ chai.use(chaiAsPromised)
const timeout = process.env.CI ? 60000 : 10000

describe('stretchly', function () {
const tempDir = `${__dirname}/stretchly-test-tmp`
const tempDir = path.join(__dirname, './stretchly-test-tmp')
const settingsFile = `${path.join(tempDir, 'config.json')}`
const settings = new AppSettings(settingsFile)

this.timeout(timeout)

async function launchAndWaitForWindowToLoad(app) {
async function launchAndWaitForWindowToLoad (app) {
await app.start()
await app.client.waitUntilWindowLoaded()
}

async function forceMicrobreak(app) {
async function forceMicrobreak (app) {
settings.set('microbreak', true)
settings.set('microbreakInterval', 200)
settings.set('microbreakNotificationInterval', 100)
Expand All @@ -39,7 +39,7 @@ describe('stretchly', function () {
this.app = new Application({
path: electronPath,
args: [
`${__dirname}/../app`
path.join(__dirname, '../app')
],
chromeDriverArgs: [
`--user-data-dir=${tempDir}`
Expand Down Expand Up @@ -72,23 +72,23 @@ describe('stretchly', function () {
})

it('creates two windows', async function () {
let windowCount = await this.app.client.getWindowCount()
const windowCount = await this.app.client.getWindowCount()
windowCount.should.equal(2)
})

it('first window is visible', async function () {
let visible = await this.app.client.browserWindow.isVisible()
const visible = await this.app.client.browserWindow.isVisible()
visible.should.equal(true)
})

it('main window is the welcome window', async function () {
let title = await this.app.client.browserWindow.getTitle()
const title = await this.app.client.browserWindow.getTitle()
title.should.contain('Welcome')
})

it('second window is not visible', async function () {
await this.app.client.windowByIndex(1)
let visible = await this.app.client.browserWindow.isVisible()
const visible = await this.app.client.browserWindow.isVisible()
visible.should.equal(false)
})
})
Expand All @@ -100,22 +100,22 @@ describe('stretchly', function () {
})

it('creates only one window', async function () {
let windowCount = await this.app.client.getWindowCount()
const windowCount = await this.app.client.getWindowCount()
windowCount.should.equal(1)
})

it('created window is not visible', async function () {
let visible = await this.app.client.browserWindow.isVisible()
const visible = await this.app.client.browserWindow.isVisible()
visible.should.equal(false)
})

it('main window is not the welcome window', async function () {
let title = await this.app.client.browserWindow.getTitle()
const title = await this.app.client.browserWindow.getTitle()
title.should.not.contain('Welcome')
})

it('main window is the Stretchly window', async function () {
let title = await this.app.client.browserWindow.getTitle()
const title = await this.app.client.browserWindow.getTitle()
title.should.equal('Stretchly')
})
})
Expand All @@ -128,22 +128,22 @@ describe('stretchly', function () {
})

it('is created', async function () {
let title = await this.app.client.browserWindow.getTitle()
const title = await this.app.client.browserWindow.getTitle()
title.should.contain('take a break')
})

it('cannot be closed', async function () {
await this.app.client.browserWindow.close()
let isDestroyed = await this.app.client.browserWindow.isDestroyed()
const isDestroyed = await this.app.client.browserWindow.isDestroyed()
isDestroyed.should.equal(false)
})

it('has postpone button', async function () {
await this.app.client.waitUntilTextExists('#postpone', 'Postpone', 500)
})

it('is not focused', async function() {
let isDestroyed = await this.app.client.browserWindow.isFocused()
it('is not focused', async function () {
const isDestroyed = await this.app.client.browserWindow.isFocused()
isDestroyed.should.equal(false)
})
})
Expand All @@ -158,12 +158,12 @@ describe('stretchly', function () {

it('cannot be closed', async function () {
await this.app.client.browserWindow.close()
let isDestroyed = await this.app.client.browserWindow.isDestroyed()
const isDestroyed = await this.app.client.browserWindow.isDestroyed()
isDestroyed.should.equal(false)
})

it('is focused', async function () {
let isFocused = await this.app.client.browserWindow.isFocused()
const isFocused = await this.app.client.browserWindow.isFocused()
isFocused.should.equal(true)
})

Expand Down

0 comments on commit 26bd543

Please sign in to comment.