Rename all test files from JS -> ES6

This commit is contained in:
Robin Ward
2020-03-25 14:51:05 -04:00
parent 6a1fe9ff87
commit 2abe85b834
281 changed files with 35 additions and 29 deletions

View File

@ -0,0 +1,89 @@
import componentTest from "helpers/component-test";
moduleForComponent("image-uploader", { integration: true });
componentTest("with image", {
template:
"{{image-uploader imageUrl='/some/upload.png' placeholderUrl='/not/used.png'}}",
async test(assert) {
assert.equal(
find(".d-icon-far-image").length,
1,
"it displays the upload icon"
);
assert.equal(
find(".d-icon-far-trash-alt").length,
1,
"it displays the trash icon"
);
assert.equal(
find(".placeholder-overlay").length,
0,
"it does not display the placeholder image"
);
await click(".image-uploader-lightbox-btn");
assert.equal(
$(".mfp-container").length,
1,
"it displays the image lightbox"
);
}
});
componentTest("without image", {
template: "{{image-uploader}}",
test(assert) {
assert.equal(
find(".d-icon-far-image").length,
1,
"it displays the upload icon"
);
assert.equal(
find(".d-icon-far-trash-alt").length,
0,
"it does not display trash icon"
);
assert.equal(
find(".image-uploader-lightbox-btn").length,
0,
"it does not display the button to open image lightbox"
);
}
});
componentTest("with placeholder", {
template: "{{image-uploader placeholderUrl='/some/image.png'}}",
test(assert) {
assert.equal(
find(".d-icon-far-image").length,
1,
"it displays the upload icon"
);
assert.equal(
find(".d-icon-far-trash-alt").length,
0,
"it does not display trash icon"
);
assert.equal(
find(".image-uploader-lightbox-btn").length,
0,
"it does not display the button to open image lightbox"
);
assert.equal(
find(".placeholder-overlay").length,
1,
"it displays the placeholder image"
);
}
});