mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 00:05:18 +00:00
Fix broken build + uncover localization tests (#702)
* Move LocalizationCatalogTests out of Localization/ SPM is treating all the files under Localization as a resource as per the Package.swift, hence it’s not even building it * Use a class object vs struct to fix build issue * Explicitly check that the output is not a l10n key * Remove skipped test
This commit is contained in:
@@ -274,14 +274,6 @@ final class PrivateChatE2ETests: XCTestCase {
|
|||||||
wait(for: [expectation], timeout: TestConstants.defaultTimeout)
|
wait(for: [expectation], timeout: TestConstants.defaultTimeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Error Handling Tests
|
|
||||||
|
|
||||||
// NOTE: This test relied on MessageRetryService which has been removed
|
|
||||||
|
|
||||||
func testDuplicateAckPrevention() throws {
|
|
||||||
throw XCTSkip("DeliveryTracker/ACK flow removed; test not applicable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - Helper Methods
|
// MARK: - Helper Methods
|
||||||
|
|
||||||
private func createMockService(peerID: String, nickname: String) -> MockBluetoothMeshService {
|
private func createMockService(peerID: String, nickname: String) -> MockBluetoothMeshService {
|
||||||
|
|||||||
+1
-1
@@ -248,7 +248,7 @@ final class LocalizationCatalogTests: XCTestCase {
|
|||||||
/// the test bundle, preventing false positives where localization keys are
|
/// the test bundle, preventing false positives where localization keys are
|
||||||
/// returned instead of translated strings.
|
/// returned instead of translated strings.
|
||||||
private func appBundle() -> Bundle {
|
private func appBundle() -> Bundle {
|
||||||
Bundle(for: BitchatApp.self)
|
Bundle(for: ChatViewModel.self)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tests to prevent regression of the pluralization format string issue
|
/// Tests to prevent regression of the pluralization format string issue
|
||||||
@@ -22,6 +22,8 @@ final class LocationNotesManagerTests: XCTestCase {
|
|||||||
XCTAssertEqual(manager.state, .noRelays)
|
XCTAssertEqual(manager.state, .noRelays)
|
||||||
XCTAssertTrue(manager.initialLoadComplete)
|
XCTAssertTrue(manager.initialLoadComplete)
|
||||||
XCTAssertEqual(manager.errorMessage, String(localized: "location_notes.error.no_relays"))
|
XCTAssertEqual(manager.errorMessage, String(localized: "location_notes.error.no_relays"))
|
||||||
|
// Make sure we're getting an actual translated value and not the localization key
|
||||||
|
XCTAssertNotEqual(manager.errorMessage, "location_notes.error.no_relays")
|
||||||
}
|
}
|
||||||
|
|
||||||
func testSendWhenNoRelaysSurfacesError() {
|
func testSendWhenNoRelaysSurfacesError() {
|
||||||
@@ -41,6 +43,8 @@ final class LocationNotesManagerTests: XCTestCase {
|
|||||||
XCTAssertFalse(sendCalled)
|
XCTAssertFalse(sendCalled)
|
||||||
XCTAssertEqual(manager.state, .noRelays)
|
XCTAssertEqual(manager.state, .noRelays)
|
||||||
XCTAssertEqual(manager.errorMessage, String(localized: "location_notes.error.no_relays"))
|
XCTAssertEqual(manager.errorMessage, String(localized: "location_notes.error.no_relays"))
|
||||||
|
// Make sure we're getting an actual translated value and not the localization key
|
||||||
|
XCTAssertNotEqual(manager.errorMessage, "location_notes.error.no_relays")
|
||||||
}
|
}
|
||||||
|
|
||||||
func testSubscribeUsesGeoRelaysAndAppendsNotes() {
|
func testSubscribeUsesGeoRelaysAndAppendsNotes() {
|
||||||
|
|||||||
Reference in New Issue
Block a user