Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
mj52951 committed Dec 20, 2024
1 parent 9270274 commit ece4b24
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/e2e/routes.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
The Licensed Work is (c) 2024 Sygma
SPDX-License-Identifier: LGPL-3.0-only
*/

import { expect } from "chai";
import { Route } from "../../src/model";

const NUMBER_OF_ROUTES = 6;

describe("Routes tests", function () {
it("should succesfully fetch all routes", async () => {
const response = await fetch("http://localhost:8000/api/routes");
const routes: Array<Route> = await response.json();
expect(routes.length).to.be.deep.equal(NUMBER_OF_ROUTES);
routes.map((route) => {
expect(route.id).to.be.not.null;
expect(route.fromDomain).to.be.not.null;
expect(route.fromDomainID).to.be.not.null;
expect(route.resource).to.be.not.null;
expect(route.resourceID).to.be.not.null;
expect(route.toDomain).to.be.not.null;
expect(route.toDomainID).to.be.not.null;
});
});
});

0 comments on commit ece4b24

Please sign in to comment.