Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iOS): DAUTests.testMondayOfCurrentWeekFormatted() unit test (uplift to 1.74.x) #27141

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ios/brave-ios/Tests/GrowthTests/DAUTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,14 @@ class DAUTests: XCTestCase {
}

func testMondayOfCurrentWeekFormatted() {
// Jan 6th, 2025
let dateForTest = Date(timeIntervalSince1970: 1_736_139_600)

// Making sure gregorian year is showing
let yearString = Date().mondayOfCurrentWeekFormatted?.truncate(length: 4, trailing: "")
let year = Int(yearString!)!

// There is no easy way to mock a different calendar in unit tests, just checking if
// year we get looks 'correct' should be good enough.
XCTAssert(year > 2018 && year < 2025)
XCTAssertEqual(year, 2025)
}

func testNonDefaultWoiExplicitDate() {
Expand Down
Loading