diff --git a/addons/web/static/src/core/tags_list/tags_list.xml b/addons/web/static/src/core/tags_list/tags_list.xml
index 437e024cfb7..931ba40dd12 100644
--- a/addons/web/static/src/core/tags_list/tags_list.xml
+++ b/addons/web/static/src/core/tags_list/tags_list.xml
@@ -18,7 +18,7 @@
{
"the counter has a tooltip displaying other items"
);
});
+
+ QUnit.test("Tags with img have a backdrop only if they can be deleted", async (assert) => {
+ class Parent extends Component {
+ setup() {
+ this.tags = [
+ {
+ id: "tag1",
+ text: "Earth",
+ img: "fake/url",
+ },
+ {
+ colorIndex: 1,
+ id: "tag2",
+ text: "Wind",
+ img: "fake/url",
+ onDelete: () => {},
+ },
+ ];
+ }
+ }
+ Parent.components = { TagsList };
+ Parent.template = xml``;
+
+ await mount(Parent, target, { env });
+ assert.containsN(target, ".o_tag", 2);
+ assert.containsNone(target.querySelectorAll(".o_tag")[0], ".o_avatar_backdrop");
+ assert.containsOnce(target.querySelectorAll(".o_tag")[1], ".o_avatar_backdrop");
+ });
});