fix(SW-1942): fixed find my booking to be case-insensitive on form input
This commit is contained in:
@@ -16,6 +16,9 @@ describe("Access booking", () => {
|
||||
it("should enable access if all is provided", () => {
|
||||
expect(accessBooking(loggedIn, "Booking", user)).toBe(ACCESS_GRANTED)
|
||||
})
|
||||
it("should enable access if all is provided and be case-insensitive", () => {
|
||||
expect(accessBooking(loggedIn, "BoOkInG", user)).toBe(ACCESS_GRANTED)
|
||||
})
|
||||
it("should prompt to login", () => {
|
||||
expect(accessBooking(loggedIn, "Booking", null)).toBe(ERROR_UNAUTHORIZED)
|
||||
})
|
||||
@@ -35,6 +38,39 @@ describe("Access booking", () => {
|
||||
ACCESS_GRANTED
|
||||
)
|
||||
})
|
||||
it("should enable access if all is provided and be case-insensitive for first name", () => {
|
||||
const cookieString = new URLSearchParams({
|
||||
confirmationNumber: "123456789",
|
||||
firstName: "AnOnYmOuS",
|
||||
lastName: "Booking",
|
||||
email: "logged+out@scandichotels.com",
|
||||
}).toString()
|
||||
expect(accessBooking(loggedOut, "Booking", null, cookieString)).toBe(
|
||||
ACCESS_GRANTED
|
||||
)
|
||||
})
|
||||
it("should enable access if all is provided and be case-insensitive for last name", () => {
|
||||
const cookieString = new URLSearchParams({
|
||||
confirmationNumber: "123456789",
|
||||
firstName: "Anonymous",
|
||||
lastName: "Booking",
|
||||
email: "logged+out@scandichotels.com",
|
||||
}).toString()
|
||||
expect(accessBooking(loggedOut, "BoOkInG", null, cookieString)).toBe(
|
||||
ACCESS_GRANTED
|
||||
)
|
||||
})
|
||||
it("should enable access if all is provided and be case-insensitive for email", () => {
|
||||
const cookieString = new URLSearchParams({
|
||||
confirmationNumber: "123456789",
|
||||
firstName: "Anonymous",
|
||||
lastName: "Booking",
|
||||
email: "LOGGED+out@scandichotels.com",
|
||||
}).toString()
|
||||
expect(accessBooking(loggedOut, "Booking", null, cookieString)).toBe(
|
||||
ACCESS_GRANTED
|
||||
)
|
||||
})
|
||||
it("should prompt logout if user is logged in", () => {
|
||||
const cookieString = new URLSearchParams({
|
||||
confirmationNumber: "123456789",
|
||||
|
||||
Reference in New Issue
Block a user