Skip to content

Commit

Permalink
test: requireObject with typeChoices
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Aug 21, 2024
1 parent 5827299 commit 2c4b0fe
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
5 changes: 5 additions & 0 deletions cypress/e2e/fundamentalTypes/array.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,11 @@ describe('Array spec', function () {
);
});
});

it('adds empty object with `requireObject`', function () {
const sel = '#requireObject ';
cy.get(sel + '[data-type="object"').should('exist');
});
});
});

Expand Down
23 changes: 23 additions & 0 deletions demo/index-instrumented.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,29 @@ setTimeout(async function () {
'Valid values set?'
]],

['h2', [
'Require object'
]],
(() => {
const typeSelection = typeChoices({
format: 'structuredCloning',
typeNamespace: 'demo-type-choices-only',
autoTrigger: false,
requireObject: true
});

return ['form', {
id: 'requireObject',
$on: {
submit (e) {
e.preventDefault();
}
}
}, [
...typeSelection.domArray
]];
})(),

['h2', [
'Convert arbitrary value to an editable menu'
]],
Expand Down
6 changes: 3 additions & 3 deletions instrumented/demo/index.js

Large diffs are not rendered by default.

0 comments on commit 2c4b0fe

Please sign in to comment.