suitescript-mocks
Version:
Set of mocks for unit testing Netsuite Suitescript 2.*
118 lines (91 loc) • 2.73 kB
JavaScript
const { options, required, assignConstructor } = require("../../../helpers.cjs");
const Field = require("./Field.cjs");
const Button = require("./Button.cjs");
()
class Form {
buttons = {};
fields = {};
title;
clientScriptFileId;
clientScriptModulePath;
("id", "label", "functionName")
("id", "label")
addButton = (options) => {
const button = new Button(options);
this.buttons[options.id] = button;
return button;
};
("id", "label", "restrictToDomains", "restrictToScriptIds", "restrictToCurrentUser", "container")
("id", "label", "restrictToDomains", "restrictToScriptIds")
addCredentialField = (options) => {};
("id", "label", "type", "source", "container")
("id", "label", "type")
addField = (options) => {
if (!options.id.startsWith("custpage")) {
throw new Error("Field id must begin with custpage");
}
const field = new Field(options);
this.fields[options.id] = field;
return field;
};
("id", "label", "tab")
("id", "label")
addFieldGroup = (options) => {};
addPageInitMessage = (options) => {};
("title", "type", "url")
("title", "type", "url")
addPageLink = (options) => {};
("label")
addResetButton = (options) => {};
("id", "restrictToScriptIds", "label", "restrictToCurrentUser", "container")
("id", "restrictToScriptIds", "label")
addSecretKeyField = (options) => {};
("id", "label", "type", "tab")
("id", "label", "type")
addSublist = (options) => {};
("label")
addSubmitButton = (options) => {};
("id", "label", "tab")
("id", "label")
addSubtab = (options) => {};
("id", "label")
("id", "label")
addTab = (options) => {};
("id")
("id")
getButton = (options) => {
return this.buttons[options.id];
};
("id")
("id")
getField = (options) => {
return this.fields[options.id];
};
("id")
("id")
getSublist = (options) => {};
("id")
("id")
getSubtab = (options) => {};
("id")
("id")
getTab = (options) => {};
getTabs = () => {};
("field", "nextfield")
("field", "nextfield")
insertField = (options) => {};
("sublist", "nextsublist")
("sublist", "nextsublist")
insertSublist = (options) => {};
("subtab", "nextsub")
("subtab", "nextsub")
insertSubtab = (options) => {};
("tab", "nexttab")
("tab", "nexttab")
insertTab = (options) => {};
("id")
("id")
removeButton = (options) => {};
updateDefaultValues = (values) => {};
}
module.exports = Form;