-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
284 additions
and
81 deletions.
There are no files selected for viewing
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
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
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
207 changes: 127 additions & 80 deletions
207
tests/integration/components/frost-bunsen-form/renderers/autocomplete-test.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
81 changes: 81 additions & 0 deletions
81
tests/integration/components/frost-bunsen-form/renderers/multi-select/error-test.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,81 @@ | ||
import {expect} from 'chai' | ||
import {$hook} from 'ember-hook' | ||
import wait from 'ember-test-helpers/wait' | ||
import {beforeEach, describe, it} from 'mocha' | ||
|
||
import {setupFormComponentTest} from 'dummy/tests/helpers/utils' | ||
|
||
const schemas = { | ||
bunsenModel: { | ||
type: 'object', | ||
required: ['foo'], | ||
properties: { | ||
foo: { | ||
type: 'array', | ||
items: { | ||
type: 'string' | ||
} | ||
}, | ||
bar: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
bunsenView: { | ||
type: 'form', | ||
version: '2.0', | ||
cells: [{ | ||
children: [{ | ||
model: 'foo', | ||
renderer: { | ||
name: 'multi-select' | ||
} | ||
}, { | ||
model: 'bar' | ||
}] | ||
}] | ||
} | ||
} | ||
|
||
describe('Integration: Component / frost-bunsen-form / renderer / multi-select error', function () { | ||
describe('when showAllErrors is false', function () { | ||
setupFormComponentTest({ | ||
...schemas, | ||
showAllErrors: false | ||
}) | ||
|
||
beforeEach(function () { | ||
return wait() | ||
}) | ||
|
||
describe('when focus is toggled', function () { | ||
beforeEach(function () { | ||
$hook('bunsenForm-foo').find('.frost-select').focus() | ||
$hook('bunsenForm-bar-input').focus() | ||
|
||
return wait() | ||
}) | ||
|
||
it('should show error', function () { | ||
const error = $hook('bunsenForm-foo').find('.frost-bunsen-error').text().trim() | ||
expect(error).to.equal('Field is required.') | ||
}) | ||
}) | ||
}) | ||
|
||
describe('when showAllErrors is true', function () { | ||
setupFormComponentTest({ | ||
...schemas, | ||
showAllErrors: true | ||
}) | ||
|
||
beforeEach(function () { | ||
return wait() | ||
}) | ||
|
||
it('should show error', function () { | ||
const error = $hook('bunsenForm-foo').find('.frost-bunsen-error').text().trim() | ||
expect(error).to.equal('Field is required.') | ||
}) | ||
}) | ||
}) |
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
Oops, something went wrong.