mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Per review, use css :has() pseudo class
It saves writing some custom javascript, less code to maintain!
This commit is contained in:
@@ -13,10 +13,7 @@ describe("TagListInputController", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
document.body.innerHTML = `
|
||||
<div
|
||||
data-controller="tag-list-input-component--tag-list-input"
|
||||
data-tag-list-input-component--tag-list-input-highlight-class-value="changed"
|
||||
>
|
||||
<div data-controller="tag-list-input-component--tag-list-input">
|
||||
<input
|
||||
value="tag 1,tag 2,tag 3"
|
||||
data-tag-list-input-component--tag-list-input-target="tagList"
|
||||
@@ -98,12 +95,6 @@ describe("TagListInputController", () => {
|
||||
expect(variant_add_tag.value).toBe("");
|
||||
});
|
||||
|
||||
it("higlights the tag list", () => {
|
||||
const tagList = document.getElementsByClassName("tags")[0];
|
||||
|
||||
expect(tagList.classList).toContain("changed");
|
||||
});
|
||||
|
||||
describe("when tag already exist", () => {
|
||||
beforeEach(() => {
|
||||
// Trying to add an existing tag
|
||||
@@ -141,12 +132,6 @@ describe("TagListInputController", () => {
|
||||
// 1 template + 2 tags
|
||||
expect(tagList.childElementCount).toBe(3);
|
||||
});
|
||||
|
||||
it("higlights the tag list", () => {
|
||||
const tagList = document.getElementsByClassName("tags")[0];
|
||||
|
||||
expect(tagList.classList).toContain("changed");
|
||||
});
|
||||
});
|
||||
|
||||
describe("filterInput", () => {
|
||||
|
||||
Reference in New Issue
Block a user