mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
753681e9e9
no issue - standardize on "{TestType}: {ModuleType}: {module-name}" for test description strings - standardize on `{module-name}-test.js` for test file names - fix deprecation notices for ember component unit tests without explicit `unit: test` or `needs: []`
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
import Ember from 'ember';
|
|
import {
|
|
describeComponent,
|
|
it
|
|
} from 'ember-mocha';
|
|
|
|
describeComponent(
|
|
'gh-trim-focus-input',
|
|
'Unit: Component: gh-trim-focus-input',
|
|
{
|
|
unit: true
|
|
},
|
|
function () {
|
|
it('trims value on focusOut', function () {
|
|
var component = this.subject({
|
|
value: 'some random stuff '
|
|
});
|
|
|
|
this.render();
|
|
|
|
component.$().focusout();
|
|
expect(component.$().val()).to.equal('some random stuff');
|
|
});
|
|
|
|
it('does not have the autofocus attribute if not set to focus', function () {
|
|
var component = this.subject({
|
|
value: 'some text',
|
|
focus: false
|
|
});
|
|
|
|
this.render();
|
|
|
|
expect(component.$().attr('autofocus')).to.not.be.ok;
|
|
});
|
|
|
|
it('has the autofocus attribute if set to focus', function () {
|
|
var component = this.subject({
|
|
value: 'some text',
|
|
focus: true
|
|
});
|
|
|
|
this.render();
|
|
|
|
expect(component.$().attr('autofocus')).to.be.ok;
|
|
});
|
|
}
|
|
);
|