Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ test("lists existing macOS windows before the New Window Dock action", async ()
expect(dock.indexOf("...entries")).toBeLessThan(dock.indexOf('label: "New Window"'))
})

test("declares UTF-8 for every inline desktop document", async () => {
const source = await Bun.file(new URL("../../../../frontend/desktop/src/main.mjs", import.meta.url)).text()

expect(source).not.toContain("data:text/html,")
expect(source.match(/data:text\/html;charset=utf-8,/g)).toHaveLength(3)
})

test("wires the packaged macOS shell to the authenticated desktop updater", async () => {
const source = await Bun.file(new URL("../../../../frontend/desktop/src/main.mjs", import.meta.url)).text()
const updater = await Bun.file(new URL("../../../../frontend/desktop/src/updater.mjs", import.meta.url)).text()
Expand Down
6 changes: 3 additions & 3 deletions frontend/desktop/src/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ async function bootstrap(splash) {
})
if (prompt.response !== 0) return false
await splash.loadURL(
`data:text/html,${encodeURIComponent('<main style="background:#11110f;color:#e8e5dc;display:grid;font:14px system-ui;height:100vh;margin:0;place-items:center"><div><h1 style="font-size:20px;margin:0 0 8px">OpenScience</h1><p style="color:#9d998f;margin:0">Installing in Applications…</p></div></main>')}`,
`data:text/html;charset=utf-8,${encodeURIComponent('<main style="background:#11110f;color:#e8e5dc;display:grid;font:14px system-ui;height:100vh;margin:0;place-items:center"><div><h1 style="font-size:20px;margin:0 0 8px">OpenScience</h1><p style="color:#9d998f;margin:0">Installing in Applications…</p></div></main>')}`,
)
let staged
try {
Expand Down Expand Up @@ -912,7 +912,7 @@ app
},
})
await splash.loadURL(
`data:text/html,${encodeURIComponent('<main style="background:#11110f;color:#e8e5dc;display:grid;font:14px system-ui;height:100vh;margin:0;place-items:center"><div><h1 style="font-size:20px;margin:0 0 8px">OpenScience</h1><p style="color:#9d998f;margin:0">Starting your local workspace…</p></div></main>')}`,
`data:text/html;charset=utf-8,${encodeURIComponent('<main style="background:#11110f;color:#e8e5dc;display:grid;font:14px system-ui;height:100vh;margin:0;place-items:center"><div><h1 style="font-size:20px;margin:0 0 8px">OpenScience</h1><p style="color:#9d998f;margin:0">Starting your local workspace…</p></div></main>')}`,
)
splash.show()
if (await bootstrap(splash)) return
Expand Down Expand Up @@ -966,7 +966,7 @@ app
return
}
await splash.loadURL(
`data:text/html,${encodeURIComponent(`<main style="font:16px system-ui;padding:48px"><h1>OpenScience could not start</h1><p>${html(message)}</p></main>`)}`,
`data:text/html;charset=utf-8,${encodeURIComponent(`<main style="font:16px system-ui;padding:48px"><h1>OpenScience could not start</h1><p>${html(message)}</p></main>`)}`,
)
}
})
Expand Down