Skip to content

Commit cd785dd

Browse files
author
jonisaa
committed
#15 update on createFactory test, modified componentsSelect to add new options, added a minimal api to the server for test purpose
1 parent a389f6c commit cd785dd

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

demo/Server.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'fs';
22
import React from 'react';
3-
import express from 'express';
3+
import express, { Router } from 'express';
44
import path from 'path';
55
import webpackConfig from '../webpack/webpack.config.demo.dev';
66
import colors from 'colors';
@@ -16,6 +16,19 @@ require.extensions['.html'] = function (module, filename) {
1616

1717
const development = process.env.NODE_ENV !== 'production';
1818
let app = express();
19+
let router = new Router();
20+
21+
router.get("/api/languages", (request, response) => {
22+
const arr = [
23+
"español",
24+
"english",
25+
"deutsch"
26+
]
27+
28+
response.status(200).json(arr);
29+
});
30+
31+
app.use(router);
1932

2033
if (development) {
2134
app.use(webpackMiddleware(webpackCompiler));

demo/presets/componentsSelect.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@
5757
{ value: 'option2', text: 'Option 2' }
5858
],
5959
help: 'This is some help'
60+
},
61+
{
62+
name: "Languages",
63+
displayName: "Languages",
64+
type: "string",
65+
component: "Select",
66+
options: {
67+
"url": "/api/languages",
68+
"label": "Languages",
69+
"value": "value"
70+
}
6071
}
6172
]
6273
}

test/createFactory.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { EditComponentFactory, DetailsComponentFactory } from '../src/index';
22
import { expect } from 'chai';
33

4-
describe("Factory creation", function() {
5-
it("User requests an edit factory", function(done) {
4+
describe("Factory creation", () => {
5+
it("User requests an edit factory", (done) => {
66

77
let correctConfig = {
88
'string': 'TextBox',
@@ -20,7 +20,7 @@ describe("Factory creation", function() {
2020
done()
2121
});
2222

23-
it("User requests an details factory", function(done) {
23+
it("User requests a details factory", (done) => {
2424
let correctConfig = {
2525
'string': 'Static',
2626
'array': 'ArrayContainer',

0 commit comments

Comments
 (0)