mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 22:11:26 +08:00
UX: Trash icon displaying when there is no upload take 2.
This commit is contained in:
@ -1,10 +1,34 @@
|
||||
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-picture-o").length,
|
||||
1,
|
||||
"it displays the upload icon"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
this.$(".d-icon-trash-o").length,
|
||||
1,
|
||||
"it displays the trash icon"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("without image", {
|
||||
template: "{{image-uploader}}",
|
||||
|
||||
test(assert) {
|
||||
assert.equal(
|
||||
this.$(".d-icon-picture-o").length,
|
||||
1,
|
||||
"it displays the upload icon"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
this.$(".d-icon-trash-o").length,
|
||||
0,
|
||||
|
Reference in New Issue
Block a user