Skip to content

Commit ecfef5f

Browse files
committed
test: read rendered Trezor debug log entries
1 parent 2e3c9a1 commit ecfef5f

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Bitkit/Views/Trezor/TrezorRootView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ struct TrezorDebugLogPanel: View {
568568
Text(entry)
569569
.font(.system(size: 10, design: .monospaced))
570570
.foregroundColor(.white.opacity(0.6))
571+
.accessibilityIdentifier("TrezorDebugLogEntry")
571572
.id(index)
572573
}
573574
}

BitkitUITests/TrezorBridgeDashboardUITests.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ final class TrezorBridgeDashboardUITests: XCTestCase {
9999
app.buttons["TrezorDebugLogToggle"].tap()
100100
let debugEntries = app.otherElements["TrezorDebugLogEntries"]
101101
XCTAssertTrue(debugEntries.waitForExistence(timeout: 5))
102-
let debugText = debugEntries.label.lowercased()
102+
let debugLogEntries = app.staticTexts.matching(identifier: "TrezorDebugLogEntry")
103+
XCTAssertGreaterThan(debugLogEntries.count, 0, "Expected visible debug log entries before checking redaction")
104+
let debugText = (0 ..< debugLogEntries.count)
105+
.map { debugLogEntries.element(boundBy: $0).label }
106+
.joined(separator: "\n")
107+
.lowercased()
103108
XCTAssertFalse(debugText.contains("all all all all"), "Debug log must not expose the deterministic mnemonic")
104109
XCTAssertFalse(debugText.contains("passphrase"), "Debug log must not expose passphrase payloads")
105110
}

0 commit comments

Comments
 (0)