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:
Islam
2025-10-01 13:16:59 +02:00
committed by GitHub
parent 2ffa709cca
commit 3183703a63
3 changed files with 6 additions and 10 deletions
@@ -274,14 +274,6 @@ final class PrivateChatE2ETests: XCTestCase {
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
private func createMockService(peerID: String, nickname: String) -> MockBluetoothMeshService {
@@ -248,7 +248,7 @@ final class LocalizationCatalogTests: XCTestCase {
/// the test bundle, preventing false positives where localization keys are
/// returned instead of translated strings.
private func appBundle() -> Bundle {
Bundle(for: BitchatApp.self)
Bundle(for: ChatViewModel.self)
}
/// Tests to prevent regression of the pluralization format string issue
+5 -1
View File
@@ -22,6 +22,8 @@ final class LocationNotesManagerTests: XCTestCase {
XCTAssertEqual(manager.state, .noRelays)
XCTAssertTrue(manager.initialLoadComplete)
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() {
@@ -40,7 +42,9 @@ final class LocationNotesManagerTests: XCTestCase {
XCTAssertFalse(sendCalled)
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() {