Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanbond committed Nov 22, 2024
1 parent 144d0c7 commit ec4c1d3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/unit/Wizard.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ describe('Wizard tests', () => {
await wait(200);
assert.equal(form.errors.length, 1, 'Should have one error from the first page');
});

it('Should validate the entire wizard\'s components when the form has been submitted', async function () {
const wizardDefinition = {
display: 'wizard',
Expand Down Expand Up @@ -580,13 +580,12 @@ describe('Wizard tests', () => {
const form = await Formio.createForm(document.createElement('div'), wizardDefinition);
assert(form, 'Form should be created');
form.submitted = true;
const checkbox = form.getComponent('triggerChange');
const clickEvent = new Event('click');
checkbox.refs.input[0].dispatchEvent(clickEvent);
form.setSubmission({ data: { triggerChange: true } });
await wait(200);
assert.equal(form.errors.length, 2, 'Should have two errors total');
assert(form.alert, 'Form should have an error list');
assert.equal(form.alert.querySelectorAll("span[ref=errorRef]").length, 2, 'Should have two errors total');
});


it('Should have validation errors when parent form is valid but nested wizard is not', function(done) {
const formElement = document.createElement('div');
Expand Down

0 comments on commit ec4c1d3

Please sign in to comment.