1.1.0 feature work: Monthly Check-in, Charts, Goals, Share, Reviews
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import XCTest
|
||||
@testable import PortfolioJournal
|
||||
|
||||
final class MonthlyCheckInViewTests: XCTestCase {
|
||||
func testMonthLabelUsesMonthAndYear() {
|
||||
var components = DateComponents()
|
||||
components.year = 2026
|
||||
components.month = 2
|
||||
components.day = 1
|
||||
let date = Calendar(identifier: .gregorian).date(from: components)!
|
||||
|
||||
let label = MonthlyCheckInView.monthLabel(
|
||||
for: date,
|
||||
relativeTo: date,
|
||||
locale: Locale(identifier: "en_US_POSIX")
|
||||
)
|
||||
|
||||
XCTAssertEqual(label, "February 2026")
|
||||
}
|
||||
|
||||
func testMonthLabelUsesPreviousMonthDuringGracePeriod() {
|
||||
var components = DateComponents()
|
||||
components.year = 2026
|
||||
components.month = 2
|
||||
components.day = 20
|
||||
let date = Calendar(identifier: .gregorian).date(from: components)!
|
||||
|
||||
let label = MonthlyCheckInView.monthLabel(
|
||||
for: date,
|
||||
relativeTo: date,
|
||||
locale: Locale(identifier: "en_US_POSIX")
|
||||
)
|
||||
|
||||
XCTAssertEqual(label, "January 2026")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user