[TLC-254] Get Type Bind config from backend

This commit is contained in:
Kim Shepherd
2022-05-03 14:10:33 +12:00
parent 8cd07de4fc
commit 833637c215
23 changed files with 123 additions and 52 deletions

View File

@@ -22,6 +22,7 @@ describe('RowParser test suite', () => {
const initFormValues = {};
const submissionScope = 'WORKSPACE';
const readOnly = false;
const typeField = 'dc_type';
beforeEach(() => {
row1 = {
@@ -338,7 +339,7 @@ describe('RowParser test suite', () => {
it('should return a DynamicRowGroupModel object', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row1, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row1, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel instanceof DynamicRowGroupModel).toBe(true);
});
@@ -346,7 +347,7 @@ describe('RowParser test suite', () => {
it('should return a row with three fields', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row1, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row1, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect((rowModel as DynamicRowGroupModel).group.length).toBe(3);
});
@@ -354,7 +355,7 @@ describe('RowParser test suite', () => {
it('should return a DynamicRowArrayModel object', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row2, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row2, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel instanceof DynamicRowArrayModel).toBe(true);
});
@@ -362,7 +363,7 @@ describe('RowParser test suite', () => {
it('should return a row that contains only scoped fields', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row3, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row3, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect((rowModel as DynamicRowGroupModel).group.length).toBe(1);
});
@@ -370,7 +371,7 @@ describe('RowParser test suite', () => {
it('should be able to parse a dropdown combo field', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row4, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row4, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel).toBeDefined();
});
@@ -378,7 +379,7 @@ describe('RowParser test suite', () => {
it('should be able to parse a lookup-name field', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row5, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row5, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel).toBeDefined();
});
@@ -386,7 +387,7 @@ describe('RowParser test suite', () => {
it('should be able to parse a list field', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row6, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row6, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel).toBeDefined();
});
@@ -394,7 +395,7 @@ describe('RowParser test suite', () => {
it('should be able to parse a date field', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row7, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row7, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel).toBeDefined();
});
@@ -402,7 +403,7 @@ describe('RowParser test suite', () => {
it('should be able to parse a tag field', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row8, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row8, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel).toBeDefined();
});
@@ -410,7 +411,7 @@ describe('RowParser test suite', () => {
it('should be able to parse a textarea field', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row9, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row9, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel).toBeDefined();
});
@@ -418,7 +419,7 @@ describe('RowParser test suite', () => {
it('should be able to parse a group field', () => {
const parser = new RowParser(undefined);
const rowModel = parser.parse(submissionId, row10, scopeUUID, initFormValues, submissionScope, readOnly);
const rowModel = parser.parse(submissionId, row10, scopeUUID, initFormValues, submissionScope, readOnly, typeField);
expect(rowModel).toBeDefined();
});