Skip to content

Commit

Permalink
test: rendering tests for histogram and frequency count (#1160)
Browse files Browse the repository at this point in the history
* refactor: compensate for checkboxes in item width

* test: rendering tests with histogram and
  frequency count

* test: upload new images
  • Loading branch information
johanlahti committed Mar 20, 2023
1 parent ef75133 commit 3f41a5c
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 0 deletions.
123 changes: 123 additions & 0 deletions test/rendering/listbox/__fixtures__/grid-frequency-histogram.js
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 test/rendering/listbox/__fixtures__/list-frequency-histogram.js
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;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3f41a5c

Please sign in to comment.