2018-11-12 15:55:56 +08:00
|
|
|
import componentTest from "helpers/component-test";
|
|
|
|
moduleForComponent("image-uploader", { integration: true });
|
|
|
|
|
2018-11-12 16:19:17 +08:00
|
|
|
componentTest("with image", {
|
|
|
|
template: "{{image-uploader imageUrl='/some/upload.png'}}",
|
|
|
|
|
|
|
|
test(assert) {
|
|
|
|
assert.equal(
|
2019-01-22 19:02:02 +08:00
|
|
|
this.$(".d-icon-far-image").length,
|
2018-11-12 16:19:17 +08:00
|
|
|
1,
|
|
|
|
"it displays the upload icon"
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
2019-01-22 19:02:02 +08:00
|
|
|
this.$(".d-icon-far-trash-alt").length,
|
2018-11-12 16:19:17 +08:00
|
|
|
1,
|
|
|
|
"it displays the trash icon"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-11-12 15:55:56 +08:00
|
|
|
componentTest("without image", {
|
|
|
|
template: "{{image-uploader}}",
|
|
|
|
|
|
|
|
test(assert) {
|
2018-11-12 16:19:17 +08:00
|
|
|
assert.equal(
|
2019-01-22 19:02:02 +08:00
|
|
|
this.$(".d-icon-far-image").length,
|
2018-11-12 16:19:17 +08:00
|
|
|
1,
|
|
|
|
"it displays the upload icon"
|
|
|
|
);
|
|
|
|
|
2018-11-12 15:55:56 +08:00
|
|
|
assert.equal(
|
2019-01-22 19:02:02 +08:00
|
|
|
this.$(".d-icon-far-trash-alt").length,
|
2018-11-12 15:55:56 +08:00
|
|
|
0,
|
|
|
|
"it does not display trash icon"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|