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 88f9852 commit 1dad11d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/e2e/domains.spec.ts
Original file line number Diff line number Diff line change
@@ -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<Domain> = 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;
});
});
});

0 comments on commit 1dad11d

Please sign in to comment.