import hotelProvider from "../utils/hotelProvider"; describe("hotelProvider utility", () => { it("should return bdc", () => { const provider = [ { id: "bdc42272" } ]; expect(hotelProvider(provider)).toEqual("bdc"); }); it("should return bdc if both are present", () => { const provider = [ { id: "bdc42272" }, { id: "hw17" } ]; expect(hotelProvider(provider)).toEqual("bdc"); }); it("should return hostelworld", () => { const provider = [ { id: "hw17" } ]; expect(hotelProvider(provider)).toEqual("hw"); }); it("should return null", () => { expect(hotelProvider([])).toBeNull(); }); });