mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 22:19:41 +01:00
29 lines
487 B
JavaScript
29 lines
487 B
JavaScript
const { getTestId } = require(".");
|
|
|
|
class MenuItemIDBuilder {
|
|
static new(type) {
|
|
return new MenuItemIDBuilder(type);
|
|
}
|
|
constructor(type) {
|
|
this.type = type;
|
|
this.suffix = "";
|
|
}
|
|
|
|
item(itemId) {
|
|
this.itemId = itemId;
|
|
return this;
|
|
}
|
|
|
|
checked() {
|
|
this.suffix = "checked";
|
|
return this;
|
|
}
|
|
|
|
build() {
|
|
return getTestId(
|
|
`${this.type}-${this.itemId}${this.suffix ? `-${this.suffix}` : ""}`
|
|
);
|
|
}
|
|
}
|
|
module.exports = MenuItemIDBuilder;
|