UNPKG

@rr0/cms

Version:

RR0 Content Management System (CMS)

32 lines (31 loc) 1.21 kB
import { beforeEach, describe, test } from "@javarome/testscript"; import { cmsTestUtil } from "../../../test/index.js"; import { fuforaTestCases } from "./FuforaTestCases.js"; import { DatasourceTestCase } from "../DatasourceTestCase.js"; import { FuforaRR0Mapping } from "./FuforaRR0Mapping.js"; describe("FuforaCaseSource", () => { const fuforaRR0Mapping = new FuforaRR0Mapping({ read: ["fetch"], write: ["backup"] }).init(cmsTestUtil); const testCase = new class extends DatasourceTestCase { constructor(mapping, sourceCases) { super(mapping, sourceCases); } getTime(c) { return c.dateTime; } sortComparator(c1, c2) { return c1.id < c2.id ? -1 : c1.id > c2.id ? 1 : 0; } }(fuforaRR0Mapping, fuforaTestCases); let context; beforeEach(() => { context = cmsTestUtil.newHtmlContext("time/1/9/7/0/11/index.html"); context.time.setYear(1970); context.time.setMonth(11); }); test("fetch", { skip: true }, async () => { await testCase.testFetch(context); }); test("render", { skip: true }, async () => { await testCase.testRender(context); }); });