mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
2f4f6db133
no issue - add ember-suave dependency - upgrade grunt-jscs dependency - add a new .jscsrc for the client's tests directory that extends from client's base .jscsrc - separate client tests in Gruntfile jscs task so they pick up the test's .jscsrc - standardize es6 usage across client
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 () {
|
|
let 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 () {
|
|
let 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 () {
|
|
let component = this.subject({
|
|
value: 'some text',
|
|
focus: true
|
|
});
|
|
|
|
this.render();
|
|
|
|
expect(component.$().attr('autofocus')).to.be.ok;
|
|
});
|
|
}
|
|
);
|