-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: rendering tests for histogram and frequency count (#1160)
* refactor: compensate for checkboxes in item width * test: rendering tests with histogram and frequency count * test: upload new images
- Loading branch information
1 parent
ef75133
commit 3f41a5c
Showing
4 changed files
with
237 additions
and
0 deletions.
There are no files selected for viewing
123 changes: 123 additions & 0 deletions
123
test/rendering/listbox/__fixtures__/grid-frequency-histogram.js
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,123 @@ | ||
const fixture = { | ||
getLayout: () => ({ | ||
title: 'Field title', | ||
qInfo: { | ||
qId: 'qId', | ||
}, | ||
visualization: 'listbox', | ||
qListObject: { | ||
qDimensionInfo: { | ||
qLocked: false, | ||
}, | ||
qSize: { | ||
qcy: 8, | ||
}, | ||
qInitialDataFetch: [{ qLeft: 0, qWidth: 0, qTop: 0, qHeight: 0 }], | ||
qFrequencyMode: 'P', | ||
frequencyEnabled: true, | ||
}, | ||
qSelectionInfo: { | ||
qInSelections: false, | ||
}, | ||
histogram: true, | ||
layoutOptions: { | ||
dataLayout: 'grid', | ||
layoutOrder: 'row', | ||
maxVisibleRows: { | ||
auto: true, | ||
maxRows: 10000000, | ||
}, | ||
maxVisibleColumns: { | ||
auto: true, | ||
maxColumns: 10, | ||
}, | ||
}, | ||
}), | ||
getListObjectData: () => [ | ||
{ | ||
qMatrix: [ | ||
[ | ||
{ | ||
qText: 'A', | ||
qNum: 'NaN', | ||
qElemNumber: 0, | ||
qState: 'L', | ||
qFrequency: '20%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'B', | ||
qNum: 'NaN', | ||
qElemNumber: 1, | ||
qState: 'A', | ||
qFrequency: '75%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'C', | ||
qNum: 'NaN', | ||
qElemNumber: 2, | ||
qState: 'S', | ||
qFrequency: '10%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'D', | ||
qNum: 'NaN', | ||
qElemNumber: 3, | ||
qState: 'XL', | ||
qFrequency: '100%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'E', | ||
qNum: 'NaN', | ||
qElemNumber: 4, | ||
qState: 'A', | ||
qFrequency: '0.0%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'F', | ||
qNum: 'NaN', | ||
qElemNumber: 5, | ||
qState: 'A', | ||
qFrequency: '50%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'G', | ||
qNum: 'NaN', | ||
qElemNumber: 6, | ||
qState: 'A', | ||
qFrequency: '10%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'H', | ||
qNum: 'NaN', | ||
qElemNumber: 7, | ||
qState: 'O', | ||
qFrequency: '75%', | ||
}, | ||
], | ||
], | ||
qTails: [], | ||
qArea: { | ||
qLeft: 0, | ||
qTop: 0, | ||
qWidth: 1, | ||
qHeight: 8, | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
export default fixture; |
114 changes: 114 additions & 0 deletions
114
test/rendering/listbox/__fixtures__/list-frequency-histogram.js
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,114 @@ | ||
const fixture = { | ||
getLayout: () => ({ | ||
title: 'Field title', | ||
qInfo: { | ||
qId: 'qId', | ||
}, | ||
visualization: 'listbox', | ||
qListObject: { | ||
qDimensionInfo: { | ||
qLocked: false, | ||
}, | ||
qSize: { | ||
qcy: 8, | ||
}, | ||
qInitialDataFetch: [{ qLeft: 0, qWidth: 0, qTop: 0, qHeight: 0 }], | ||
qFrequencyMode: 'P', | ||
frequencyEnabled: true, | ||
}, | ||
qSelectionInfo: { | ||
qInSelections: false, | ||
}, | ||
histogram: true, | ||
layoutOptions: { | ||
dataLayout: 'singleColumn', | ||
}, | ||
}), | ||
getListObjectData: () => [ | ||
{ | ||
qMatrix: [ | ||
[ | ||
{ | ||
qText: 'A', | ||
qNum: 'NaN', | ||
qElemNumber: 0, | ||
qState: 'L', | ||
qFrequency: '20%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'B', | ||
qNum: 'NaN', | ||
qElemNumber: 1, | ||
qState: 'A', | ||
qFrequency: '75%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'C', | ||
qNum: 'NaN', | ||
qElemNumber: 2, | ||
qState: 'S', | ||
qFrequency: '10%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'D', | ||
qNum: 'NaN', | ||
qElemNumber: 3, | ||
qState: 'XL', | ||
qFrequency: '100%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'E', | ||
qNum: 'NaN', | ||
qElemNumber: 4, | ||
qState: 'A', | ||
qFrequency: '0.0%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'F', | ||
qNum: 'NaN', | ||
qElemNumber: 5, | ||
qState: 'A', | ||
qFrequency: '50%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'G', | ||
qNum: 'NaN', | ||
qElemNumber: 6, | ||
qState: 'A', | ||
qFrequency: '10%', | ||
}, | ||
], | ||
[ | ||
{ | ||
qText: 'H', | ||
qNum: 'NaN', | ||
qElemNumber: 7, | ||
qState: 'O', | ||
qFrequency: '75%', | ||
}, | ||
], | ||
], | ||
qTails: [], | ||
qArea: { | ||
qLeft: 0, | ||
qTop: 0, | ||
qWidth: 1, | ||
qHeight: 8, | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
export default fixture; |
Binary file added
BIN
+6.94 KB
...ndering/listbox/listbox.spec.js-snapshots/grid-frequency-histogram-js-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.1 KB
...ndering/listbox/listbox.spec.js-snapshots/list-frequency-histogram-js-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.