mirror of
https://github.com/samsonjs/Peekaboo.git
synced 2026-04-26 14:57:47 +00:00
Fix JSON structure expectations in Swift CLI tests
- Update to expect success/data wrapper in JSON responses - Match actual Swift CLI output format
This commit is contained in:
parent
41a43117d6
commit
228ee053b2
1 changed files with 6 additions and 6 deletions
|
|
@ -235,13 +235,13 @@ function checkSwift() {
|
|||
}
|
||||
|
||||
try {
|
||||
const appsData = JSON.parse(appsOutput);
|
||||
if (!appsData.applications || !Array.isArray(appsData.applications)) {
|
||||
const response = JSON.parse(appsOutput);
|
||||
if (!response.success || !response.data || !response.data.applications || !Array.isArray(response.data.applications)) {
|
||||
logError('Apps list has invalid structure');
|
||||
return false;
|
||||
}
|
||||
// Should always have at least some apps running
|
||||
if (appsData.applications.length === 0) {
|
||||
if (response.data.applications.length === 0) {
|
||||
logError('No running applications found');
|
||||
return false;
|
||||
}
|
||||
|
|
@ -258,13 +258,13 @@ function checkSwift() {
|
|||
}
|
||||
|
||||
try {
|
||||
const windowsData = JSON.parse(windowsOutput);
|
||||
if (!windowsData.windows || !Array.isArray(windowsData.windows)) {
|
||||
const response = JSON.parse(windowsOutput);
|
||||
if (!response.success || !response.data || !response.data.windows || !Array.isArray(response.data.windows)) {
|
||||
logError('Windows list has invalid structure');
|
||||
return false;
|
||||
}
|
||||
// Finder might not have windows, so just check structure
|
||||
if (!windowsData.target_application_info) {
|
||||
if (!response.data.target_application_info) {
|
||||
logError('Windows response missing target_application_info');
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue