mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-01 07:53:26 +00:00
test: cover bridge status summary
off state, enabled state with a cell and nearby-only compose, and the zero-bridged-peers case.
This commit is contained in:
parent
0d4e37632e
commit
108818d6eb
28
bitchatTests/Services/BridgeStatusSummaryTests.swift
Normal file
28
bitchatTests/Services/BridgeStatusSummaryTests.swift
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// BridgeStatusSummaryTests.swift
|
||||
// bitchatTests
|
||||
//
|
||||
// This is free and unencumbered software released into the public domain.
|
||||
// For more information, see <https://unlicense.org>
|
||||
//
|
||||
|
||||
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"))
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user