2020-05-17 20:12:03 +03:00
|
|
|
const { elmPagesCliFile, elmPagesUiFile } = require("../generator/src/elm-file-constants.js");
|
2020-08-23 07:34:47 +03:00
|
|
|
const { generateTemplateModuleConnector } = require("../generator/src/generate-template-module-connector.js");
|
2020-05-17 20:12:03 +03:00
|
|
|
const generateRecords = require("../generator/src/generate-records.js");
|
|
|
|
|
2020-05-17 22:21:55 +03:00
|
|
|
test('generate UI file', async () => {
|
2020-06-17 06:51:44 +03:00
|
|
|
process.chdir(__dirname);
|
2020-05-17 22:21:55 +03:00
|
|
|
const staticRoutes = await generateRecords();
|
2020-05-17 20:12:03 +03:00
|
|
|
|
|
|
|
global.builtAt = new Date("Sun, 17 May 2020 16:53:22 GMT");
|
|
|
|
expect(elmPagesUiFile(staticRoutes, [])).toMatchSnapshot();
|
|
|
|
});
|
2020-08-23 07:34:47 +03:00
|
|
|
|
|
|
|
test('generate template module connector', async () => {
|
|
|
|
process.chdir(__dirname);
|
2020-08-23 17:35:03 +03:00
|
|
|
const generated = await generateTemplateModuleConnector();
|
2020-08-23 07:34:47 +03:00
|
|
|
|
|
|
|
expect(generated).toMatchSnapshot();
|
|
|
|
});
|