fix(KAN-65): show the installed macOS build number
CI/CD / preconditions (pull_request) Successful in 2s
Native JavaScript checks / Native launcher and release tests (pull_request) Successful in 58s
macOS checks / Native Rust tests and unsigned build (pull_request) Successful in 2m0s
CI/CD / test_and_check_app (pull_request) Successful in 6m28s
CI/CD / Publish immutable image (pull_request) Skipped
CI/CD / preconditions (pull_request) Successful in 2s
Native JavaScript checks / Native launcher and release tests (pull_request) Successful in 58s
macOS checks / Native Rust tests and unsigned build (pull_request) Successful in 2m0s
CI/CD / test_and_check_app (pull_request) Successful in 6m28s
CI/CD / Publish immutable image (pull_request) Skipped
This commit is contained in:
@@ -16,8 +16,16 @@ fn main() {
|
||||
};
|
||||
use tauri::webview::PageLoadEvent;
|
||||
let passed = Arc::new(AtomicBool::new(false));
|
||||
let config: serde_json::Value =
|
||||
serde_json::from_str(include_str!("../tauri.conf.json")).unwrap();
|
||||
let expected_installed = format!(
|
||||
"Installed version {} (build {})",
|
||||
config["version"].as_str().unwrap(),
|
||||
config["bundle"]["macOS"]["bundleVersion"].as_str().unwrap()
|
||||
);
|
||||
|
||||
let plugin = tauri::plugin::Builder::<tauri::Wry>::new("updater-smoke")
|
||||
.js_init_script(format!("window.expectedInstalled = {};", serde_json::to_string(&expected_installed).unwrap()))
|
||||
.on_page_load(|window, payload| {
|
||||
if window.label() != "updates" || payload.event() != PageLoadEvent::Finished { return; }
|
||||
window.eval(r#"
|
||||
@@ -26,6 +34,8 @@ fn main() {
|
||||
for (let i = 0; i < 100 && !window.updateStatus; i++) await new Promise(r => setTimeout(r, 50));
|
||||
if (!window.updateStatus) throw new Error('Update UI did not load');
|
||||
const $ = id => document.getElementById(id);
|
||||
for (let i = 0; i < 100 && !$('installed').textContent; i++) await new Promise(r => setTimeout(r, 50));
|
||||
if ($('installed').textContent !== window.expectedInstalled) throw new Error('Actual installed version/build failed: ' + $('installed').textContent);
|
||||
const state = { phase: 'current', currentVersion: '0.1.2', build: '2', version: null, notes: null, downloaded: 0, total: null, error: null, preferences: { automatic: true, intervalHours: 6 } };
|
||||
window.updateStatus(state);
|
||||
if (!$('installed').textContent.includes('0.1.2 (build 2)') || !$('install').hidden || $('check').disabled) throw new Error('Current version state failed');
|
||||
|
||||
Reference in New Issue
Block a user