Merge pull request #311 from James-Sangalli/add-test-for-locale-change

Add test case for switching locale
pull/313/head
James Sangalli 7 years ago committed by GitHub
commit 92f513977b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      TrustTests/Settings/ConfigTests.swift

@ -28,5 +28,28 @@ class ConfigTests: XCTestCase {
XCTAssertEqual(false, config.isCryptoPrimaryCurrency)
}
func testSwitchLocale() {
var config: Config = .make()
config.locale = AppLocale.english.id
let vc1 = TokensViewController(
session: .make(),
account: .make(),
dataStore: FakeTokensDataStore()
)
XCTAssertEqual(vc1.title, "Wallet")
config.locale = AppLocale.simplifiedChinese.id
let vc2 = TokensViewController(
session: .make(),
account: .make(),
dataStore: FakeTokensDataStore()
)
XCTAssertEqual(vc2.title, "我的钱包")
//Must change this back to system, otherwise other tests will break either immediately or the next run
config.locale = AppLocale.system.id
}
}

Loading…
Cancel
Save