diff --git a/tests/integration/http-client/get_account_sources.http b/tests/integration/http-client/get_account_sources.http index 932a1b5..79e09f6 100644 --- a/tests/integration/http-client/get_account_sources.http +++ b/tests/integration/http-client/get_account_sources.http @@ -18,14 +18,20 @@ Authorization: Bearer dummy-token client.assert(sources.nodeName === "sources", "Root element is not 'sources'"); const sourceList = sources.getElementsByTagName("source"); - client.assert(sourceList.length >= 4, "Expected at least 4 source elements, found " + sourceList.length); + client.assert(sourceList.length >= 3, "Expected at least 3 source elements, found " + sourceList.length); - const expectedIds = ["10001", "10002", "10003", "10004"]; + // AUX (id=10001, sourceproviderid=9) is intentionally excluded from + // cloud responses — real Bose never emitted AUX in /full or /sources; + // the speaker enumerates AUX from its own hardware via isLocal=true + // in :8090/sources. See pkg/service/marge/marge.go getAccountSources + // and commit 2b40481 (#195/#269). + const expectedIds = ["10002", "10003", "10004"]; for (let i = 0; i < sourceList.length; i++) { const source = sourceList.item(i); const sourceId = source.getAttribute("id"); + client.assert(sourceId !== "10001", "Cloud /sources must not include AUX (id=10001)"); if (i < expectedIds.length) { - client.assert(sourceId === expectedIds[i], "Wrong source ID at index " + i); + client.assert(sourceId === expectedIds[i], "Wrong source ID at index " + i + ": got " + sourceId + ", want " + expectedIds[i]); } client.assert(source.getAttribute("type") === "Audio", "Wrong source type for source " + sourceId); diff --git a/tests/integration/http-client/get_full_account.http b/tests/integration/http-client/get_full_account.http index c228f4e..cfee6e8 100644 --- a/tests/integration/http-client/get_full_account.http +++ b/tests/integration/http-client/get_full_account.http @@ -47,6 +47,18 @@ Authorization: Bearer {{token}} client.assert(sources !== null, "Missing 'sources' element"); var sourceCount = sources.getElementsByTagName("source").length; client.assert(sourceCount > 0, "No 'source' elements found in account sources"); - client.assert(sourceCount === 6, "Expected 6 sources (AUX, INTERNET_RADIO, LOCAL_INTERNET_RADIO, TUNEIN, RADIO_BROWSER, Spotify) but got " + sourceCount); + // AUX (sourceproviderid=9) is intentionally excluded from cloud-side + // /full responses — real Bose never emitted it; the speaker enumerates + // AUX from its own hardware via isLocal=true in :8090/sources. See + // pkg/service/marge/marge.go getAccountSources for the reasoning and + // commit 2b40481 for the fix that closed #195/#269. + client.assert(sourceCount === 5, "Expected 5 cloud sources (INTERNET_RADIO, LOCAL_INTERNET_RADIO, TUNEIN, RADIO_BROWSER, Spotify; AUX is hardware-local) but got " + sourceCount); + + // Explicit negative assertion: AUX must not appear in /full. + var sourceList = sources.getElementsByTagName("source"); + for (var i = 0; i < sourceList.length; i++) { + var pid = sourceList[i].getElementsByTagName("sourceproviderid")[0]; + client.assert(!pid || pid.textContent !== "9", "/full must not include AUX (sourceproviderid=9)"); + } }); %}