Skip to content

Commit

Permalink
chore(test): wip test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra committed Aug 31, 2024
1 parent b6d75c5 commit 8a6fe66
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"postinstall": "base-volta-off-of-nwjs",
"lint": "exit 0",
"test": "vitest run",
"dev": "nw ./tests/fixtures/custom"
"dev": "nw ./tests/fixtures/nw/window"
},
"devDependencies": {
"@types/chrome": "^0.0.270",
Expand Down
30 changes: 30 additions & 0 deletions tests/fixtures/nw/window/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
let polyfill;
import('../../src/polyfill.js').then(module => {
polyfill = module.default;
polyfill();
});
document.addEventListener('DOMContentLoaded', () => {
const mainWindow = nw.Window.get();
mainWindow.showDevTools(() => {
document.getElementById('nw-window-isdevtoolsopen').innerText = mainWindow.isDevToolsOpen();
});
});
</script>
<title>nw.Window fixture</title>
</head>

<body>
<div>
<span>nw.Window.isDevToolsOpen: </span>
<span id="nw-window-isdevtoolsopen"></span>
</div>
</body>

</html>
4 changes: 4 additions & 0 deletions tests/fixtures/nw/window/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "nw-app",
"main": "index.html"
}

0 comments on commit 8a6fe66

Please sign in to comment.