| ... | @@ -199,7 +199,9 @@ describe("DesktopAppIdentity", () => { | ... | @@ -199,7 +199,9 @@ describe("DesktopAppIdentity", () => { |
| 199 | assert.equal(calls.setAboutPanelOptions[0]?.applicationName, "T3 Code (Alpha)"); | 199 | assert.equal(calls.setAboutPanelOptions[0]?.applicationName, "T3 Code (Alpha)"); |
| 200 | assert.equal(calls.setAboutPanelOptions[0]?.applicationVersion, "1.2.3"); | 200 | assert.equal(calls.setAboutPanelOptions[0]?.applicationVersion, "1.2.3"); |
| 201 | assert.equal(calls.setAboutPanelOptions[0]?.version, "0123456789ab"); | 201 | assert.equal(calls.setAboutPanelOptions[0]?.version, "0123456789ab"); |
| 202 | assert.deepEqual(calls.setDockIcon, ["/icon.png"]); | 202 | // Packaged: the bundle's own icon stands, so a custom one the user |
| | 203 | // attached survives. |
| | 204 | assert.deepEqual(calls.setDockIcon, []); |
| 203 | }), | 205 | }), |
| 204 | { | 206 | { |
| 205 | calls, | 207 | calls, |
| ... | @@ -212,4 +214,28 @@ describe("DesktopAppIdentity", () => { | ... | @@ -212,4 +214,28 @@ describe("DesktopAppIdentity", () => { |
| 212 | }, | 214 | }, |
| 213 | ); | 215 | ); |
| 214 | }); | 216 | }); |
| | 217 | |
| | 218 | it.effect("sets the dock icon only when running unpackaged", () => { |
| | 219 | const calls: ElectronAppCalls = { |
| | 220 | setAboutPanelOptions: [], |
| | 221 | setDockIcon: [], |
| | 222 | setName: [], |
| | 223 | }; |
| | 224 | |
| | 225 | return withIdentity( |
| | 226 | Effect.gen(function* () { |
| | 227 | const identity = yield* DesktopAppIdentity.DesktopAppIdentity; |
| | 228 | yield* identity.configure; |
| | 229 | |
| | 230 | // Electron shows a generic icon for an unpackaged run, which is the |
| | 231 | // reason this call exists at all. |
| | 232 | assert.deepEqual(calls.setDockIcon, ["/icon.png"]); |
| | 233 | }), |
| | 234 | { |
| | 235 | calls, |
| | 236 | environment: { isPackaged: false }, |
| | 237 | pngIconPath: Option.some("/icon.png"), |
| | 238 | }, |
| | 239 | ); |
| | 240 | }); |
| 215 | }); | 241 | }); |