Skip to content

Commit

Permalink
test: add rendering tests
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Wizard committed Mar 15, 2023
1 parent 1519ada commit f4446b9
Show file tree
Hide file tree
Showing 2 changed files with 158 additions and 0 deletions.
79 changes: 79 additions & 0 deletions test/rendering/listbox/__fixtures__/locked_states.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
const fixture = {
getLayout: () => ({
title: 'Field title',
qInfo: {
qId: 'qId',
},
visualization: 'listbox',
qListObject: {
qDimensionInfo: {
qLocked: true,
},
qSize: {
qcy: 5,
},
qInitialDataFetch: [{ qLeft: 0, qWidth: 0, qTop: 0, qHeight: 0 }],
},
qSelectionInfo: {
qInSelections: false,
},
layoutOptions: {
layoutOrder: 'row',
},
}),
getListObjectData: () => [
{
qMatrix: [
[
{
qText: 'Locked',
qNum: 'NaN',
qElemNumber: 0,
qState: 'L',
},
],
[
{
qText: 'Alternative',
qNum: 'NaN',
qElemNumber: 1,
qState: 'A',
},
],
[
{
qText: 'Optional',
qNum: 'NaN',
qElemNumber: 2,
qState: 'O',
},
],
[
{
qText: 'Locked Excluded',
qNum: 'NaN',
qElemNumber: 3,
qState: 'XL',
},
],
[
{
qText: 'Excluded',
qNum: 'NaN',
qElemNumber: 4,
qState: 'X',
},
],
],
qTails: [],
qArea: {
qLeft: 0,
qTop: 0,
qWidth: 1,
qHeight: 5,
},
},
],
};

export default fixture;
79 changes: 79 additions & 0 deletions test/rendering/listbox/__fixtures__/not_locked_states.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
const fixture = {
getLayout: () => ({
title: 'Field title',
qInfo: {
qId: 'qId',
},
visualization: 'listbox',
qListObject: {
qDimensionInfo: {
qLocked: false,
},
qSize: {
qcy: 5,
},
qInitialDataFetch: [{ qLeft: 0, qWidth: 0, qTop: 0, qHeight: 0 }],
},
qSelectionInfo: {
qInSelections: false,
},
layoutOptions: {
layoutOrder: 'row',
},
}),
getListObjectData: () => [
{
qMatrix: [
[
{
qText: 'Selected',
qNum: 'NaN',
qElemNumber: 0,
qState: 'S',
},
],
[
{
qText: 'Alternative',
qNum: 'NaN',
qElemNumber: 1,
qState: 'A',
},
],
[
{
qText: 'Optional',
qNum: 'NaN',
qElemNumber: 2,
qState: 'O',
},
],
[
{
qText: 'Selected Excluded',
qNum: 'NaN',
qElemNumber: 3,
qState: 'XS',
},
],
[
{
qText: 'Excluded',
qNum: 'NaN',
qElemNumber: 4,
qState: 'X',
},
],
],
qTails: [],
qArea: {
qLeft: 0,
qTop: 0,
qWidth: 1,
qHeight: 5,
},
},
],
};

export default fixture;

0 comments on commit f4446b9

Please sign in to comment.