Refactor `assert_sparkline`