From 1dad11d8284883cd0913963c7128af7aec70afc0 Mon Sep 17 00:00:00 2001 From: mj52951 Date: Fri, 20 Dec 2024 16:27:17 +0100 Subject: [PATCH] Add e2e test --- tests/e2e/domains.spec.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/e2e/domains.spec.ts diff --git a/tests/e2e/domains.spec.ts b/tests/e2e/domains.spec.ts new file mode 100644 index 0000000..ddd30d7 --- /dev/null +++ b/tests/e2e/domains.spec.ts @@ -0,0 +1,24 @@ +/* +The Licensed Work is (c) 2024 Sygma +SPDX-License-Identifier: LGPL-3.0-only +*/ + +import { expect } from "chai"; +import { Domain } from "../../src/model"; + +const NUMBER_OF_DOMAINS = 3; + +describe("Domains tests", function () { + it("should succesfully fetch all domains", async () => { + const response = await fetch("http://localhost:8000/api/domains"); + const domains: Array = await response.json(); + expect(domains.length).to.be.deep.equal(NUMBER_OF_DOMAINS); + domains.map((domain) => { + expect(domain.id).to.be.not.null; + expect(domain.name).to.be.not.null; + expect(domain.type).to.be.not.null; + expect(domain.iconURL).to.be.not.null; + expect(domain.explorerURL).to.be.not.null; + }); + }); +});