diff --git a/bitchatTests/Services/BridgeStatusSummaryTests.swift b/bitchatTests/Services/BridgeStatusSummaryTests.swift new file mode 100644 index 00000000..bf9b92d2 --- /dev/null +++ b/bitchatTests/Services/BridgeStatusSummaryTests.swift @@ -0,0 +1,28 @@ +// +// BridgeStatusSummaryTests.swift +// bitchatTests +// +// This is free and unencumbered software released into the public domain. +// For more information, see +// + +import Testing +@testable import bitchat + +struct BridgeStatusSummaryTests { + @Test func offStateDoesNotMentionBridgePeople() { + let text = BridgeStatusSummary.formatted(enabled: false, cell: "u4pruy", bridgedCount: 3, nearbyOnly: false) + #expect(text.lowercased().contains("bridge off")) + } + + @Test func enabledStateIncludesCellAndCount() { + let text = BridgeStatusSummary.formatted(enabled: true, cell: "u4pruy", bridgedCount: 2, nearbyOnly: true) + #expect(text.contains("u4pruy")) + #expect(text.contains("nearby")) + } + + @Test func enabledWithZeroPeersMentionsBridgeCell() { + let text = BridgeStatusSummary.formatted(enabled: true, cell: "u4pruy", bridgedCount: 0, nearbyOnly: false) + #expect(text.localizedCaseInsensitiveContains("u4pruy") || text.localizedCaseInsensitiveContains("bridge")) + } +}