Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Dec 23, 2021
1 parent e1d23fe commit dfc20cf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Test
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm ci
- name: Run Test
run: npm run test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build:styles": "concurrently 'npm:watch:tw' 'npm:watch:gb'",
"watch:gb": "sass src/global.scss src/global.css --no-source-map --style compressed --watch",
"watch:tw": "tailwindcss build -i src/tailwind.scss -o src/tailwind.css -c .tailwindrc.js --no-autoprefixer --minify --watch",
"test": "npx playwright test",
"lint": "eslint --fix .",
"eslint": "eslint ."
},
Expand Down
18 changes: 18 additions & 0 deletions tests/landing.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { _electron: electron } = require("playwright")
const { test, expect } = require("@playwright/test")

test("Test landing window", async () => {
const electronApp = await electron.launch({ args: ["."] })

const state = await electronApp.evaluate(async ({ BrowserWindow }) => {
const mainWindow = BrowserWindow.getAllWindows()[0]

return {
isDestroyed: mainWindow.isDestroyed(),
isCrashed: mainWindow.webContents.isCrashed(),
}
})

expect(state.isDestroyed).toBeFalsy()
expect(state.isCrashed).toBeFalsy()
})

0 comments on commit dfc20cf

Please sign in to comment.