2023-12-01 10:47:54 -05:00
|
|
|
import hbs from "htmlbars-inline-precompile";
|
2021-02-18 06:06:22 -05:00
|
|
|
import componentTest, {
|
|
|
|
setupRenderingTest,
|
|
|
|
} from "discourse/tests/helpers/component-test";
|
|
|
|
import { discourseModule, exists } from "discourse/tests/helpers/qunit-helpers";
|
|
|
|
|
|
|
|
discourseModule(
|
|
|
|
"Data Explorer Plugin | Integration | Component | data-explorer-bar-chart",
|
|
|
|
function (hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
|
|
|
|
|
|
|
componentTest("it renders a chart", {
|
|
|
|
template: hbs`{{data-explorer-bar-chart}}`,
|
|
|
|
|
|
|
|
beforeEach() {
|
|
|
|
this.set("labels", ["label_1", "label_2"]);
|
|
|
|
this.set("values", [115, 1000]);
|
|
|
|
this.set("datasetName", "data");
|
|
|
|
},
|
|
|
|
|
|
|
|
async test(assert) {
|
|
|
|
assert.ok(exists("canvas"), "it renders a canvas");
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|