mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 12:55:16 -07:00
fix(updater): handle unsupported macOS app updates
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createUpdateDialogPresenter, type ShowMessageBox } from './update-dialogs';
|
||||
import {
|
||||
createUpdateDialogPresenter,
|
||||
showManualUpdateRequiredDialog,
|
||||
type ShowMessageBox,
|
||||
} from './update-dialogs';
|
||||
|
||||
test('update dialog presenter focuses app before showing macOS dialogs', async () => {
|
||||
const calls: string[] = [];
|
||||
@@ -35,3 +39,26 @@ test('update dialog presenter does not focus app before showing non-macOS dialog
|
||||
|
||||
assert.deepEqual(calls, ['dialog:SubMiner is up to date (v0.14.0)']);
|
||||
});
|
||||
|
||||
test('manual update required dialog explains that automatic install is unavailable', async () => {
|
||||
let shown:
|
||||
| {
|
||||
type?: string;
|
||||
title?: string;
|
||||
message: string;
|
||||
detail?: string;
|
||||
buttons?: string[];
|
||||
}
|
||||
| undefined;
|
||||
const showMessageBox: ShowMessageBox = async (options) => {
|
||||
shown = options;
|
||||
return { response: 0 };
|
||||
};
|
||||
|
||||
await showManualUpdateRequiredDialog(showMessageBox, '0.15.0-beta.1');
|
||||
|
||||
assert.equal(shown?.type, 'warning');
|
||||
assert.equal(shown?.message, 'Manual install required');
|
||||
assert.match(shown?.detail ?? '', /SubMiner v0\.15\.0-beta\.1 is available/);
|
||||
assert.match(shown?.detail ?? '', /cannot install app updates automatically/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user