mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 08:46:19 +08:00
39 lines
786 B
JavaScript
39 lines
786 B
JavaScript
import componentTest from "helpers/component-test";
|
|
moduleForComponent("image-uploader", { integration: true });
|
|
|
|
componentTest("with image", {
|
|
template: "{{image-uploader imageUrl='/some/upload.png'}}",
|
|
|
|
test(assert) {
|
|
assert.equal(
|
|
this.$(".d-icon-far-image").length,
|
|
1,
|
|
"it displays the upload icon"
|
|
);
|
|
|
|
assert.equal(
|
|
this.$(".d-icon-far-trash-alt").length,
|
|
1,
|
|
"it displays the trash icon"
|
|
);
|
|
}
|
|
});
|
|
|
|
componentTest("without image", {
|
|
template: "{{image-uploader}}",
|
|
|
|
test(assert) {
|
|
assert.equal(
|
|
this.$(".d-icon-far-image").length,
|
|
1,
|
|
"it displays the upload icon"
|
|
);
|
|
|
|
assert.equal(
|
|
this.$(".d-icon-far-trash-alt").length,
|
|
0,
|
|
"it does not display trash icon"
|
|
);
|
|
}
|
|
});
|