mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
UX: Trash icon displaying when there is no upload take 2.
This commit is contained in:
parent
d50f4fdd7a
commit
c7377e2f2d
2 changed files with 26 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue