diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index 0c51487122..d457e0c1b6 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -46,4 +46,10 @@ export default class AppApi { const json = await response.json() return [response, json.data] } + + async getRoutes(): Promise<[Response, any]> { + const response = await this.api.get(`/routing`) + const json = await response.json() + return [response, json] + } } diff --git a/qa-core/src/tests/internal-api/screens/screens.spec.ts b/qa-core/src/tests/internal-api/screens/screens.spec.ts index e43c241f7c..8774d48007 100644 --- a/qa-core/src/tests/internal-api/screens/screens.spec.ts +++ b/qa-core/src/tests/internal-api/screens/screens.spec.ts @@ -30,7 +30,23 @@ describe("Internal API - /screens endpoints", () => { const [response, screen] = await config.screen.createScreen(generateScreen()) expect(response).toHaveStatusCode(200) expect(screen.routing.roleId).toEqual("BASIC") + }) + it("GET - Fetch screens", async () => { + // Create app + const [appResponse, app] = await appConfig.applications.create(generateApp()) + expect(appResponse).toHaveStatusCode(200) + expect(app._id).toBeDefined() + + // Create Screen + appConfig.applications.api.appId = app.appId + const [response, screen] = await config.screen.createScreen(generateScreen()) + expect(response).toHaveStatusCode(200) + + // Check screen exists + const [routesResponse, routes] = await appConfig.applications.getRoutes() + expect(routesResponse).toHaveStatusCode(200) + expect(routes.routes["/test"]).toBeTruthy() }) it("DELETE - Delete a screen", async () => {