From 22eb689ebfaabf8e54aef07d8d38622ff740aeba Mon Sep 17 00:00:00 2001 From: Butch Mayhew Date: Mon, 13 Jan 2025 23:55:16 -0600 Subject: [PATCH] fixing branding test --- bruno/branding/PUT branding.bru | 2 +- lib/datafactory/room.ts | 2 +- lib/helpers/branding.ts | 4 +++- tests/branding/branding.spec.ts | 3 ++- tests/room/room.get.spec.ts | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bruno/branding/PUT branding.bru b/bruno/branding/PUT branding.bru index 129d8fd..0b28160 100644 --- a/bruno/branding/PUT branding.bru +++ b/bruno/branding/PUT branding.bru @@ -21,7 +21,7 @@ body:json { "latitude": 52.6351204, "longitude": 1.2733774 }, - "logoUrl": "https://www.mwtestconsultancy.co.uk/img/rbp-logo.png", + "logoUrl": "/images/rbp-logo.jpg", "description": "Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.", "contact": { "name": "Shady Meadows B&B", diff --git a/lib/datafactory/room.ts b/lib/datafactory/room.ts index 64de182..8898f8b 100644 --- a/lib/datafactory/room.ts +++ b/lib/datafactory/room.ts @@ -60,7 +60,7 @@ export const defaultRoom = { roomName: "101", type: "single", accessible: true, - image: "https://www.mwtestconsultancy.co.uk/img/testim/room2.jpg", + image: "/images/room2.jpg", description: "Aenean porttitor mauris sit amet lacinia molestie. In posuere accumsan aliquet. Maecenas sit amet nisl massa. Interdum et malesuada fames ac ante.", features: ["TV", "WiFi", "Safe"], diff --git a/lib/helpers/branding.ts b/lib/helpers/branding.ts index 1afd718..bad603c 100644 --- a/lib/helpers/branding.ts +++ b/lib/helpers/branding.ts @@ -1,10 +1,12 @@ +import Env from "./env"; + export const defaultBranding = { name: "Shady Meadows B&B", map: { latitude: 52.6351204, longitude: 1.2733774, }, - logoUrl: "https://www.mwtestconsultancy.co.uk/img/rbp-logo.png", + logoUrl: `${Env.URL}/images/room2.jpg`, description: "Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.", contact: { diff --git a/tests/branding/branding.spec.ts b/tests/branding/branding.spec.ts index fb272db..ff1e8e1 100644 --- a/tests/branding/branding.spec.ts +++ b/tests/branding/branding.spec.ts @@ -35,10 +35,11 @@ test.describe("branding/ PUT requests", async () => { }); test.afterEach(async ({ request }) => { - await request.put("branding/", { + const response = await request.put("branding/", { headers: headers, data: defaultBody, }); + expect(response.status()).toBe(202); }); test("PUT website branding", async ({ request }) => { diff --git a/tests/room/room.get.spec.ts b/tests/room/room.get.spec.ts index 3ad53aa..a6abc05 100644 --- a/tests/room/room.get.spec.ts +++ b/tests/room/room.get.spec.ts @@ -42,7 +42,7 @@ test.describe("room/ GET requests @room", async () => { expect(firstRoom.roomid).toBe(1); expect(firstRoom.roomName).toBe("101"); expect(firstRoom.type).toBe("single"); - expect(firstRoom.image).toBe("https://www.mwtestconsultancy.co.uk/img/testim/room2.jpg"); + expect(firstRoom.image).toBe("/images/room2.jpg"); expect(firstRoom.description).toBe( "Aenean porttitor mauris sit amet lacinia molestie. In posuere accumsan aliquet. Maecenas sit amet nisl massa. Interdum et malesuada fames ac ante." );