fix: make sure all tests pass

This commit is contained in:
thecodrr
2022-02-15 10:21:52 +05:00
parent f449fb6c33
commit 111ffa94ce
18 changed files with 125 additions and 100 deletions

View File

@@ -6,6 +6,7 @@ class MenuItemIDBuilder {
}
constructor(type) {
this.type = type;
this.suffix = "";
}
item(itemId) {
@@ -13,18 +14,15 @@ class MenuItemIDBuilder {
return this;
}
colorCheck(color) {
this.itemId = "colors-" + color + "-check";
return this;
}
color(color) {
this.itemId = "colors-" + color;
checked() {
this.suffix = "checked";
return this;
}
build() {
return getTestId(`${this.type}-${this.itemId}`);
return getTestId(
`${this.type}-${this.itemId}${this.suffix ? `-${this.suffix}` : ""}`
);
}
}
module.exports = MenuItemIDBuilder;