1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-08 21:10:05 +00:00

fix: master tests fixed

This commit is contained in:
Saad Jutt
2021-05-06 22:28:06 +05:00
parent 665734b168
commit 80e5de5d65
4 changed files with 104 additions and 27 deletions

View File

@@ -59,10 +59,15 @@ export const basicTests = (
"Should trigger required login callback and after successful login, it should finish the request",
test: async () => {
await adapter.logOut();
return await adapter.request("common/sendArr", stringData, null, () => {
adapter.logIn(userName, password);
});
return await adapter.request(
"common/sendArr",
stringData,
undefined,
() => {
adapter.logIn(userName, password);
}
);
},
assertion: (response: any) => {
return response.table1[0][0] === stringData.table1[0].col1;
@@ -75,9 +80,9 @@ export const basicTests = (
test: async () => {
const config = {
debug: true
}
};
return await adapter.request("common/sendArr", stringData, config)
return await adapter.request("common/sendArr", stringData, config);
},
assertion: (response: any) => {
return response.table1[0][0] === stringData.table1[0].col1;

View File

@@ -15,6 +15,7 @@ const multipleRowsWithNulls: any = {
{ col1: 42, col2: 1.62, col3: "x", col4: "x" }
]
};
const multipleColumnsWithNulls: any = {
table1: [
{ col1: 42, col2: null, col3: "x", col4: null },
@@ -136,7 +137,8 @@ export const sendArrTests = (adapter: SASjs): TestSuite => ({
res.table1[index][2] === multipleRowsWithNulls.table1[index].col3;
result =
result &&
res.table1[index][3] === multipleRowsWithNulls.table1[index].col4;
res.table1[index][3] ===
(multipleRowsWithNulls.table1[index].col4 || " ");
});
return result;
}
@@ -165,7 +167,7 @@ export const sendArrTests = (adapter: SASjs): TestSuite => ({
result =
result &&
res.table1[index][3] ===
(multipleColumnsWithNulls.table1[index].col4 || "");
(multipleColumnsWithNulls.table1[index].col4 || " ");
});
return result;
}
@@ -280,7 +282,8 @@ export const sendObjTests = (adapter: SASjs): TestSuite => ({
res.table1[index].COL3 === multipleRowsWithNulls.table1[index].col3;
result =
result &&
res.table1[index].COL4 === multipleRowsWithNulls.table1[index].col4;
res.table1[index].COL4 ===
(multipleRowsWithNulls.table1[index].col4 || " ");
});
return result;
}
@@ -309,7 +312,7 @@ export const sendObjTests = (adapter: SASjs): TestSuite => ({
result =
result &&
res.table1[index].COL4 ===
(multipleColumnsWithNulls.table1[index].col4 || "");
(multipleColumnsWithNulls.table1[index].col4 || " ");
});
return result;
}