Skip to content

Commit 4d365eb

Browse files
committed
Added and checked tests
1 parent 823d400 commit 4d365eb

File tree

1 file changed

+16
-50
lines changed

1 file changed

+16
-50
lines changed

src/test/unit-test/api-integration/helpers/format/address.test.js

Lines changed: 16 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -56,57 +56,23 @@ describe("- splitAddressByLastDot helper (Unit Test)", () => {
5656
splitAddressByLastDotResult = await splitAddressByLastDot(undefined);
5757
await expect(typeof splitAddressByLastDotResult == "string").toBe(true);
5858
});
59-
60-
// msg = "Should return a string type if others arguments are passed ";
61-
// it(msg, async () => {
62-
// splitAddressByLastDotResult = await currentDateTime(TODAY_DATE);
63-
// await expect(typeof splitAddressByLastDotResult == "string").toBe(true);
64-
// });
65-
66-
// msg = "Should return a string type if a null value is passed";
67-
// it(msg, async () => {
68-
// splitAddressByLastDotResult = await currentDateTime(null);
69-
// await expect(typeof splitAddressByLastDotResult == "string").toBe(true);
70-
// });
71-
72-
// msg = "Should return a string type if a undefined value is passed";
73-
// it(msg, async () => {
74-
// splitAddressByLastDotResult = await currentDateTime(undefined);
75-
// await expect(typeof splitAddressByLastDotResult == "string").toBe(true);
76-
// });
7759
});
7860

79-
// describe("2) Check cases for return.", () => {
80-
// msg =
81-
// "Should return a string type with 'DD/MM/YY HH:MM:SS' format (Ex: 2023-03-18 21:06:15)";
82-
// it(msg, async () => {
83-
// splitAddressByLastDotResult = await currentDateTime();
84-
// await expect(typeof splitAddressByLastDotResult == "string").toBe(true);
85-
// let characters = "/,:";
86-
// let totalCharacters = 4; // total characters for DD/MM/YY HH:MM:SS
87-
// let numberCharactersMatch = await calculateNumberOfCharactersMatch(
88-
// splitAddressByLastDotResult,
89-
// characters
90-
// );
91-
// await expect(numberCharactersMatch >= totalCharacters).toBe(true);
92-
// });
93-
// });
94-
95-
// describe("3) Check cases for error.", () => {
96-
// msg =
97-
// "Should not return a error message if no argument is passed to the function.";
98-
// it(msg, async () => {
99-
// await expect(async () => await currentDateTime()).not.toThrow(Error);
100-
// splitAddressByLastDotResult = await currentDateTime();
101-
// await expect(typeof splitAddressByLastDotResult == "string").toBe(true);
102-
// });
61+
describe("2) Check cases for error.", () => {
62+
msg =
63+
"Should not return a error message and not throw an error if no argument is passed to the function.";
64+
it(msg, async () => {
65+
await expect(async () => await splitAddressByLastDot()).not.toThrow(
66+
Error
67+
);
68+
});
10369

104-
// msg =
105-
// "Should return a string and not throw an Error if a new Error is passed";
106-
// it(msg, async () => {
107-
// splitAddressByLastDotResult = await currentDateTime(new Error());
108-
// await expect(async () => splitAddressByLastDotResult).not.toThrow(Error);
109-
// await expect(typeof splitAddressByLastDotResult == "string").toBe(true);
110-
// });
111-
// });
70+
msg =
71+
"Should not return a error message and not throw an error if a new Error() is passed to the function.";
72+
it(msg, async () => {
73+
await expect(
74+
async () => await splitAddressByLastDot(new Error())
75+
).not.toThrow(Error);
76+
});
77+
});
11278
});

0 commit comments

Comments
 (0)