Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
feat: writing tests for chart rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
MitanOmar committed Apr 26, 2023
1 parent b1f1d98 commit 699906e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/integration/components/statistic-list/bar/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,30 @@ module("Integration | Component | statistic list/bar", function (hooks) {
"0.5"
);
});

test("The Chart color is RED when spent effort is over the budget", async function (assert) {
await render(
hbs`<StatisticList::Bar @value={{0.5}} @goal={{0.4}} @remaining={{0}} />`
);

const element = this.element.querySelector(".statistic-list-bar");

assert.ok(element);

assert.true(element.classList.contains("strong-danger"));
assert.false(element.classList.contains("strong-success"));
});

test("The Chart color is GREEN when spent effort is in the budget", async function (assert) {
await render(
hbs`<StatisticList::Bar @value={{0.5}} @goal={{0.6}} @remaining={{0}} />`
);

const element = this.element.querySelector(".statistic-list-bar");

assert.ok(element);

assert.false(element.classList.contains("strong-danger"));
assert.true(element.classList.contains("strong-success"));
});
});

0 comments on commit 699906e

Please sign in to comment.