Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit 1aff537

Browse files
krolikowskidamianlukaszMycs
authored andcommitted
Fix: Issue #5 remove all mycs occurrences (#14)
* commit * increase version
1 parent 8757f71 commit 1aff537

File tree

7 files changed

+7
-23
lines changed

7 files changed

+7
-23
lines changed

Examples/Jest/1.0/exampleClientScript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function saveRecord() {
1919
const confirmMessage = "Do you want to auto approve this order?\nIf yes click on 'Ok' button.\nIf not please click on 'Cancel' button";
2020
// eslint-disable-next-line no-restricted-globals, no-alert
2121
if (confirm(confirmMessage)) {
22-
nlapiSetFieldValue('custbody_mycs_auto_approva_manual_ord', 'T');
22+
nlapiSetFieldValue('custbody_auto_approva_manual_ord', 'T');
2323
}
2424

2525
return true;

Examples/Jest/1.0/exampleClientScript.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('salesorder_CL', () => {
1818
'Do you want to auto approve this order?\nIf yes click on \'Ok\' button.\nIf not please click on \'Cancel\' button',
1919
);
2020
expect(spyAlert).not.toHaveBeenCalled();
21-
expect(spySet).toHaveBeenCalledWith('custbody_mycs_auto_approva_manual_ord', 'T');
21+
expect(spySet).toHaveBeenCalledWith('custbody_auto_approva_manual_ord', 'T');
2222
expect(result).toEqual(true);
2323
});
2424
it('should not display confirm and retun true for subsidiary 1 ', () => {

Examples/Jest/2.0/exampleClientScript.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fileUnderTest = require('./exampleClientScript');
22

33
const defaultValues = {
44
tranid: '12121',
5-
custbody_mycs_ship_method: 23,
5+
custbody_ship_method: 23,
66
shipstatus: 'B',
77
custbodysps_packagedetails: 'test',
88
};

Examples/Mocha/2.0/exampleClientScript.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const fileUnderTest = require('./exampleClientScript');
44

55
const defaultValues = {
66
tranid: '12121',
7-
custbody_mycs_ship_method: 23,
7+
custbody_ship_method: 23,
88
shipstatus: 'B',
99
custbodysps_packagedetails: 'test',
1010
};

N/search.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,18 @@ function createFilter(options) { // eslint-disable-line no-unused-vars
3232
*/
3333
function ResultSet() {
3434
const privateColumns = this.columns || [];
35-
const times = this.type === 'customrecord_mycs_script_settings' ? 1 : Math.floor(Math.random() * 99) + 1;
35+
const times = Math.floor(Math.random() * 99) + 1;
3636
const mockupData = _.map(_.times(times), item => ({
3737
id: item + 1,
3838
type: this.type,
3939
columns: privateColumns.map(columnName => ({ name: columnName })),
4040
getValue(column) {
41-
const hardcodedValues = {
42-
custrecord_mycs_ship_meth_is_assembly: false,
43-
custrecord_mycs_ship_meth_sel_method: 10,
44-
custrecord_mycs_ship_meth_config_coll_wg: random(1, 30),
45-
custrecord_mycs_ship_meth_max_colli_l: random(1, 30),
46-
custrecord_mycs_ship_meth_max_colli_w: random(1, 30),
47-
custrecord_mycs_ship_meth_max_colli_h: random(1, 30),
48-
custrecord_mycs_ship_meth_max_order_val: random(1, 30),
49-
custrecord_mycs_ship_meth_max_order_wgh: random(1, 30),
50-
custrecord_mycs_ship_meth_max_colli_cnt: random(1, 30),
51-
custrecord_mycs_url: '',
52-
};
5341
const privateData = _.reduce(
5442
privateColumns,
5543
(result, columnName) => {
5644
const columnNameText = columnName.name || columnName;
5745
const singleResult = result;
58-
const calFn = Object.prototype.hasOwnProperty;
59-
singleResult[columnNameText] = calFn.call(hardcodedValues, columnNameText)
60-
? hardcodedValues[columnNameText] : `${columnNameText}_${item + 1}`;
46+
singleResult[columnNameText] = `${columnNameText}_${item + 1}`;
6147
singleResult.internalid = random(1, 9000);
6248
return result;
6349
},

SuiteScriptMockup1.0/nsmockup-1.0.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,6 @@ exports.nlapiGetLineItemMatrixField = function (type, fldnam, linenum, column) {
538538
*/
539539
exports.nlapiGetFieldValue = function (fldnam) {
540540
switch (fldnam) {
541-
case 'custbody_mycs_pick_ticket_printed':
542-
return 'T';
543541
case 'subsidiary':
544542
return random(1, 9);
545543
default:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ns-suitescript-mocks",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Collection of mocks that can be used to improve unit-tests for SuiteScript 2.0.",
55
"main": "index.js",
66
"author": "Damian Krolikowski",

0 commit comments

Comments
 (0)