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