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 committed Jun 8, 2023
1 parent 56b4f22 commit 51468ce
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 51468ce

Please sign in to comment.