Skip to content

Commit 5d82aed

Browse files
committed
Updates based on CR feedback.
1 parent f6a61ed commit 5d82aed

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Yosemite/Yosemite/Stores/AppSettingsStore.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,6 @@ enum AppSettingsStoreErrors: Error {
848848
case writeOrdersSettings
849849
case writeProductsSettings
850850
case noEligibilityErrorInfo
851-
case noLastJetpackBenefitsBannerDismissedTime
852851
}
853852

854853

Yosemite/YosemiteTests/Stores/AppSettingsStoreTests.swift

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,10 @@ final class AppSettingsStoreTests: XCTestCase {
521521

522522
func test_loadJetpackBenefitsBannerVisibility_returns_true_on_new_generalAppSettings() throws {
523523
// Given
524+
// Deletes any pre-existing app settings.
524525
try fileStorage?.deleteFile(at: expectedGeneralAppSettingsFileURL)
525526

527+
// GMT - Sunday, November 28, 2021 1:25:24 PM
526528
let currentTime = Date(timeIntervalSince1970: 1638105924)
527529
let calendar = Calendar(identifier: .gregorian)
528530

@@ -535,6 +537,7 @@ final class AppSettingsStoreTests: XCTestCase {
535537
}
536538

537539
// Then
540+
// The banner is visible if there are no pre-existing app settings.
538541
XCTAssertTrue(isVisible)
539542
}
540543

@@ -548,11 +551,11 @@ final class AppSettingsStoreTests: XCTestCase {
548551
let currentTime = Date(timeIntervalSince1970: 1638105924)
549552
let calendar: Calendar = {
550553
var calendar = Calendar(identifier: .gregorian)
551-
guard let timeZoneWithoutDailySavingTime = TimeZone(identifier: "Asia/Taipei") else {
554+
guard let timeZoneWithoutDaylightSavingTime = TimeZone(identifier: "Asia/Taipei") else {
552555
XCTFail("Unexpected time zone.")
553556
return calendar
554557
}
555-
calendar.timeZone = timeZoneWithoutDailySavingTime
558+
calendar.timeZone = timeZoneWithoutDaylightSavingTime
556559
return calendar
557560
}()
558561

@@ -571,7 +574,7 @@ final class AppSettingsStoreTests: XCTestCase {
571574
XCTAssertTrue(isVisible)
572575
}
573576

574-
/// Tests an edge case where the time interval since the last dismissed date is less than 5 24-hour days, but is exactly 5 days on calendar with daily
577+
/// Tests an edge case where the time interval since the last dismissed date is less than 5 24-hour days, but is exactly 5 days on calendar with daylight
575578
/// saving time.
576579
func test_loadJetpackBenefitsBannerVisibility_returns_false_after_setting_last_dismissed_date_exactly_five_24hr_days_ago() throws {
577580
// Given
@@ -580,15 +583,15 @@ final class AppSettingsStoreTests: XCTestCase {
580583
// America/New York (EDT) - November 03, 2021 09:43:17 AM
581584
let lastDismissedTime = Date(timeIntervalSince1970: 1635946997)
582585
// America/New York (EST) - November 08, 2021 08:43:17 AM - exactly five 24-hour days after the last dismissed date.
583-
// But with daily saving time in America/New York, it is still less than five days.
586+
// But with daylight saving time in America/New York, it is still less than five days.
584587
let currentTime = Date(timeIntervalSince1970: 1636378997)
585588
let calendar: Calendar = {
586589
var calendar = Calendar(identifier: .gregorian)
587-
guard let timeZoneWithDailySavingTime = TimeZone(identifier: "America/New_York") else {
590+
guard let timeZoneWithDaylightSavingTime = TimeZone(identifier: "America/New_York") else {
588591
XCTFail("Unexpected time zone.")
589592
return calendar
590593
}
591-
calendar.timeZone = timeZoneWithDailySavingTime
594+
calendar.timeZone = timeZoneWithDaylightSavingTime
592595
return calendar
593596
}()
594597

@@ -617,11 +620,11 @@ final class AppSettingsStoreTests: XCTestCase {
617620
let currentTime = Date(timeIntervalSince1970: 1638105923)
618621
let calendar: Calendar = {
619622
var calendar = Calendar(identifier: .gregorian)
620-
guard let timeZoneWithoutDailySavingTime = TimeZone(identifier: "Asia/Taipei") else {
623+
guard let timeZoneWithoutDaylightSavingTime = TimeZone(identifier: "Asia/Taipei") else {
621624
XCTFail("Unexpected time zone.")
622625
return calendar
623626
}
624-
calendar.timeZone = timeZoneWithoutDailySavingTime
627+
calendar.timeZone = timeZoneWithoutDaylightSavingTime
625628
return calendar
626629
}()
627630

0 commit comments

Comments
 (0)