-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
490 additions
and
12,116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { expect } from 'chai'; | ||
|
||
import { filterProcessSync } from '../'; | ||
import { generateProcessorContext } from '../../__tests__/fixtures/util'; | ||
|
||
it('Should not filter empty array value for dataGrid component', async () => { | ||
const dataGridComp = { | ||
type: 'datagrid', | ||
key: 'dataGrid', | ||
input: true, | ||
path: 'dataGrid', | ||
components: [ | ||
{ | ||
type: 'textfield', | ||
key: 'textField', | ||
input: true, | ||
label: 'Text Field' | ||
} | ||
] | ||
}; | ||
const data = { | ||
dataGrid: [] | ||
}; | ||
const context: any = generateProcessorContext(dataGridComp, data); | ||
filterProcessSync(context); | ||
expect(context.scope.filter).to.deep.equal({'dataGrid': {'compModelType': 'array', 'include': true}}); | ||
}); | ||
|
||
it('Should not filter empty array value for editGrid component', async () => { | ||
const editGridComp = { | ||
type: 'editgrid', | ||
key: 'editGrid', | ||
input: true, | ||
path: 'editGrid', | ||
components: [ | ||
{ | ||
type: 'textfield', | ||
key: 'textField', | ||
input: true, | ||
label: 'Text Field' | ||
} | ||
] | ||
}; | ||
const data = { | ||
editGrid: [] | ||
}; | ||
const context: any = generateProcessorContext(editGridComp, data); | ||
filterProcessSync(context); | ||
expect(context.scope.filter).to.deep.equal({'editGrid': {'compModelType': 'array', 'include': true}}); | ||
}); | ||
|
||
it('Should not filter empty array value for datTable component', async () => { | ||
const dataTableComp = { | ||
type: 'datatable', | ||
key: 'dataTable', | ||
input: true, | ||
path: 'dataTable', | ||
components: [ | ||
{ | ||
type: 'textfield', | ||
key: 'textField', | ||
input: true, | ||
label: 'Text Field' | ||
} | ||
] | ||
}; | ||
const data = { | ||
dataTable: [] | ||
}; | ||
const context: any = generateProcessorContext(dataTableComp, data); | ||
filterProcessSync(context); | ||
expect(context.scope.filter).to.deep.equal({'dataTable': {'compModelType': 'array', 'include': true}}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.