From 717274c1a8f2eb20d9acc91451deee4976931da4 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sun, 25 Oct 2020 14:00:27 -0500 Subject: [PATCH] Fix tests. --- Clocker/ClockerUITests/OnboardingTests.swift | 14 +++++++------- Clocker/ClockerUITests/PreferencesTest.swift | 2 +- Clocker/Overall App/Themer.swift | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Clocker/ClockerUITests/OnboardingTests.swift b/Clocker/ClockerUITests/OnboardingTests.swift index ddb6fcd..e97b8b0 100644 --- a/Clocker/ClockerUITests/OnboardingTests.swift +++ b/Clocker/ClockerUITests/OnboardingTests.swift @@ -123,8 +123,8 @@ class OnboardingTests: XCTestCase { private func startupControllerTests() { let onboardingWindow = app.windows["OnboardingWindow"] - XCTAssertTrue(onboardingWindow.buttons["Forward"].title == "Open Clocker At Login", "Forward button title's was unexpectedly wrong") - XCTAssertTrue(onboardingWindow.buttons["Alternate"].title == "Don't Open", "Alternate button title's was unexpectedly wrong") + XCTAssertTrue(onboardingWindow.buttons["Forward"].title == "Open Clocker At Login".localizedString(), "Forward button title's was unexpectedly wrong") + XCTAssertTrue(onboardingWindow.buttons["Alternate"].title == "Don't Open".localizedString(), "Alternate button title's was unexpectedly wrong") XCTAssertTrue(onboardingWindow.staticTexts["Launch at Login".localizedString()].exists, "Header label's static text was unexpectedly wrong.") XCTAssertTrue(onboardingWindow.staticTexts["Should Clocker open automatically on startup?".localizedString()].exists, "Accessory label's static text was unexpectedly wrong.") @@ -137,17 +137,17 @@ class OnboardingTests: XCTestCase { XCTAssertTrue(onboardingWindow.buttons["Forward"].title == "Continue".localizedString(), "Forward button title's was unexpectedly wrong") XCTAssertTrue(onboardingWindow.staticTexts["Quick Add Locations".localizedString()].exists, "Header label's static text was unexpectedly wrong.") - XCTAssertTrue(onboardingWindow.staticTexts["More search options in Clocker Preferences."].exists, "Accessory label's static text was unexpectedly wrong.") + XCTAssertTrue(onboardingWindow.staticTexts["More search options in Clocker Preferences.".localizedString()].exists, "Accessory label's static text was unexpectedly wrong.") } private func finalOnboardingControllerTests() { let onboardingWindow = app.windows["OnboardingWindow"] // Let's test the buttons - XCTAssertTrue(onboardingWindow.staticTexts["You're all set!"].exists, "Header label's static text was unexpectedly wrong.") - XCTAssertTrue(onboardingWindow.staticTexts["Thank you for the details."].exists, "Accessory label's static text was unexpectedly wrong.") + XCTAssertTrue(onboardingWindow.staticTexts["You're all set!".localizedString()].exists, "Header label's static text was unexpectedly wrong.") + XCTAssertTrue(onboardingWindow.staticTexts["Thank you for the details.".localizedString()].exists, "Accessory label's static text was unexpectedly wrong.") - XCTAssertFalse(onboardingWindow.buttons["Alternate"].exists, "Alternate button was unexpectedly present.") - XCTAssertTrue(onboardingWindow.buttons["Forward"].title == "Launch Clocker".localizedString(), "Forward button's title was unexpectedly wrong.") + XCTAssertFalse(onboardingWindow.buttons["Alternate".localizedString()].exists, "Alternate button was unexpectedly present.") + XCTAssertTrue(onboardingWindow.buttons["Forward".localizedString()].title == "Launch Clocker".localizedString(), "Forward button's title was unexpectedly wrong.") } } diff --git a/Clocker/ClockerUITests/PreferencesTest.swift b/Clocker/ClockerUITests/PreferencesTest.swift index a0b052a..d795fb0 100644 --- a/Clocker/ClockerUITests/PreferencesTest.swift +++ b/Clocker/ClockerUITests/PreferencesTest.swift @@ -244,7 +244,7 @@ class PreferencesTest: XCTestCase { XCTAssertTrue(maxCharacterQuery.count > 0) addAPlace(place: "asdakjhdasdahsdasd", to: app, shouldSleep: false) - XCTAssertTrue(app.sheets.staticTexts["Please select a timezone!"].exists) + XCTAssertTrue(app.sheets.staticTexts["No Timezone Selected".localizedString()].exists) let informativeLabelPredicate = NSPredicate(format: "placeholderValue like %@", "No results! 😔 Try entering the exact name.") let sheets = app.sheets.firstMatch.staticTexts diff --git a/Clocker/Overall App/Themer.swift b/Clocker/Overall App/Themer.swift index 66b2c27..3d8e639 100644 --- a/Clocker/Overall App/Themer.swift +++ b/Clocker/Overall App/Themer.swift @@ -187,8 +187,8 @@ extension Themer { return themeIndex == .light - ? NSImage(named: NSImage.Name("Settings"))! - : NSImage(named: NSImage.Name("Settings-White"))! + ? NSImage(named: NSImage.Name("Settings"))! + : NSImage(named: NSImage.Name("Settings-White"))! } func pinImage() -> NSImage {