import BookmarkPopularityMapper from "../resources/bookmarkPopularity/mapper"; describe("BookmarkPopularityMapper", () => { it("should map a bookmark popularity to a bookmark popularity model", () => { const mapper = new BookmarkPopularityMapper(); const model = mapper.toModel({ "type": "bookmark-popularity", "relationships": { "target": { "links": { "related": "/pois/381139" }, "data": { "type": "poi", "id": "381139" } } }, "id": "0cacc176-f4c5-4d43-adf8-fd1d3f9f3c04", "attributes": { "bookmark_count": 49 } }); expect(model.count).toEqual(49); expect(model.target.id).toBe("381139"); expect(model.target.type).toBe("poi"); }); });