Skip to content

Commit

Permalink
fix ChartsOrg#5033: always run snapshot tests in light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pmairoldi authored and apollonian committed Mar 11, 2024
1 parent b4c5f49 commit bcbacad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ChartsDemo-iOS/Swift/Demos/PieChartViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ class PieChartViewController: DemoBaseViewController {

chartView.data = data
chartView.highlightValues(nil)


var highlights: [Highlight] = []
for entry in entries {
let highlight = Highlight(x: entry.x, y: entry.y, dataSetIndex: 0)
highlights.append(highlight)
}
chartView.highlightValues(highlights)
}

override func optionTapped(_ option: Option) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/ChartsTests/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func assertChartSnapshot<Value: ChartViewBase>(

let failure = verifySnapshot(
matching: try value(),
as: .image,
as: .image(traits: .init(userInterfaceStyle: .light)),
record: recording,
snapshotDirectory: snapshotDirectory,
timeout: timeout,
Expand Down

0 comments on commit bcbacad

Please sign in to comment.