mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 14:09:34 +01:00
31 lines
517 B
JavaScript
31 lines
517 B
JavaScript
|
|
const { getTestId } = require(".");
|
||
|
|
|
||
|
|
class MenuItemIDBuilder {
|
||
|
|
static new(type) {
|
||
|
|
return new MenuItemIDBuilder(type);
|
||
|
|
}
|
||
|
|
constructor(type) {
|
||
|
|
this.type = type;
|
||
|
|
}
|
||
|
|
|
||
|
|
item(itemId) {
|
||
|
|
this.itemId = itemId;
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
|
||
|
|
colorCheck(color) {
|
||
|
|
this.itemId = "colors-" + color + "-check";
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
|
||
|
|
color(color) {
|
||
|
|
this.itemId = "colors-" + color;
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
|
||
|
|
build() {
|
||
|
|
return getTestId(`${this.type}-${this.itemId}`);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
module.exports = MenuItemIDBuilder;
|