forked from Yara724/api
updated the fucking mf fanavaran
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
asPartyInquiryRows,
|
||||
collectPersonNationalCodes,
|
||||
parseJalaliDateParts,
|
||||
pickPersonBirthday,
|
||||
pickPersonNationalCode,
|
||||
@@ -24,8 +25,17 @@ describe("selectFanavaranDriverId", () => {
|
||||
expect(selectFanavaranDriverId([{ Id: 20, RoleId: 166 }], true)).toBe(20);
|
||||
});
|
||||
|
||||
it("unwraps a wrapped Fanavaran payload", () => {
|
||||
expect(selectFanavaranDriverId({ value: rows }, true)).toBe(10);
|
||||
it("picks 4773521 from a real Fanavaran unique-identifier response", () => {
|
||||
expect(
|
||||
selectFanavaranDriverId(
|
||||
[
|
||||
{ Id: 4773521, RoleId: 161 },
|
||||
{ Id: 4773521, RoleId: 163 },
|
||||
{ Id: 4773521, RoleId: 166 },
|
||||
],
|
||||
true,
|
||||
),
|
||||
).toBe(4773521);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -51,11 +61,16 @@ describe("pickPersonNationalCode / birthday", () => {
|
||||
});
|
||||
|
||||
describe("asPartyInquiryRows", () => {
|
||||
it("parses compact Jalali birthday 13480313", () => {
|
||||
expect(parseJalaliDateParts("13480313")).toEqual({
|
||||
year: 1348,
|
||||
month: 3,
|
||||
day: 13,
|
||||
it("normalizes Persian digits and compact insurer birthday 13640628", () => {
|
||||
expect(
|
||||
collectPersonNationalCodes({
|
||||
nationalCodeOfInsurer: "۰۰۸۰۰۸۶۵۱۹",
|
||||
}),
|
||||
).toEqual(["0080086519"]);
|
||||
expect(parseJalaliDateParts(13640628)).toEqual({
|
||||
year: 1364,
|
||||
month: 6,
|
||||
day: 28,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user