/ tests / models / Feed.test.ts
Feed.test.ts
 1  import feeds from "@!/feeds.json";
 2  import { describe, expect, it } from "bun:test";
 3  import { deserialize } from "desero";
 4  import { Feed } from "~/models";
 5  
 6  describe("FeedDTO", () => {
 7    it("should decode [0] to domain properly", () => {
 8      const feed = deserialize(Feed, feeds.results[0]);
 9      expect(feed.identifier).toBe("aix.marseille");
10      expect(feed.isDefault).toBe(false);
11      expect(feed.name).toBe("AIX-MARSEILLE");
12    });
13  
14    it("should decode [1] to domain properly", () => {
15      const feed = deserialize(Feed, feeds.results[1]);
16      expect(feed.identifier).toBe("amiens");
17      expect(feed.isDefault).toBe(false);
18      expect(feed.name).toBe("AMIENS");
19    });
20  
21    it("should decode [2] to domain properly", () => {
22      const feed = deserialize(Feed, feeds.results[2]);
23      expect(feed.identifier).toBe("reunion");
24      expect(feed.isDefault).toBe(false);
25      expect(feed.name).toBe("LA REUNION");
26    });
27  });