Merge pull request #5921 from kevinansfield/standardise-test-names

Standardize ember test names and file names
This commit is contained in:
Hannah Wolfe 2015-10-06 18:49:10 +01:00
commit b784ba0f4c
40 changed files with 110 additions and 67 deletions

View File

@ -9,7 +9,7 @@ const { run } = Ember;
describeComponent(
'gh-navigation',
'Integration : Component : gh-navigation',
'Integration: Component: gh-navigation',
{
integration: true
},

View File

@ -9,7 +9,7 @@ const { run } = Ember;
describeComponent(
'gh-navitem',
'Integration : Component : gh-navitem',
'Integration: Component: gh-navitem',
{
integration: true
},

View File

@ -14,7 +14,7 @@ const { run } = Ember,
describeComponent(
'gh-navitem-url-input',
'Integration : Component : gh-navitem-url-input', {
'Integration: Component: gh-navitem-url-input', {
integration: true
},
function () {

View File

@ -9,7 +9,9 @@ import sinon from 'sinon';
describeComponent(
'gh-alert',
'GhAlertComponent', {
'Unit: Component: gh-alert',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -10,7 +10,9 @@ import sinon from 'sinon';
describeComponent(
'gh-alerts',
'GhAlertsComponent', {
'Unit: Component: gh-alerts',
{
unit: true,
// specify the other units that are required for this test
needs: ['component:gh-alert']
},

View File

@ -7,10 +7,11 @@ import {
describeComponent(
'gh-app',
'GhAppComponent',
'Unit: Component: gh-app',
{
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},
function () {
it('renders', function () {

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-content-preview-content',
'GhContentPreviewContentComponent',
'Unit: Component: gh-content-preview-content',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-editor-save-button',
'GhEditorSaveButtonComponent',
'Unit: Component: gh-editor-save-button',
{
unit: true,
needs: [
'component:gh-dropdown-button',
'component:gh-dropdown',

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-editor',
'GhEditorComponent',
'Unit: Component: gh-editor',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-infinite-scroll-box',
'GhInfiniteScrollBoxComponent',
'Unit: Component: gh-infinite-scroll-box',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-infinite-scroll',
'GhInfiniteScrollComponent',
'Unit: Component: gh-infinite-scroll',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -8,8 +8,10 @@ import {
describeComponent(
'gh-navitem-url-input',
'GhNavitemUrlInputComponent',
{},
'Unit: Component: gh-navitem-url-input',
{
unit: true
},
function () {
it('identifies a URL as the base URL', function () {
var component = this.subject({

View File

@ -9,7 +9,9 @@ import sinon from 'sinon';
describeComponent(
'gh-notification',
'GhNotificationComponent', {
'Unit: Component: gh-notification',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -9,8 +9,8 @@ from 'ember-mocha';
describeComponent(
'gh-notifications',
'GhNotificationsComponent', {
// specify the other units that are required for this test
'Unit: Component: gh-notifications', {
unit: true,
needs: ['component:gh-notification']
},
function () {

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-posts-list-item',
'GhPostsListItemComponent',
'Unit: Component: gh-posts-list-item',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -6,9 +6,14 @@ import {
it
} from 'ember-mocha';
describeComponent('gh-profile-image', 'GhProfileImageComponent', {
describeComponent(
'gh-profile-image',
'Unit: Component: gh-profile-image',
{
unit: true,
needs: ['service:ghost-paths']
}, function () {
},
function () {
it('renders', function () {
// creates the component instance
var component = this.subject();

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-search-input',
'GhSearchInputComponent',
'Unit: Component: gh-search-input',
{
unit: true,
needs: ['component:gh-selectize']
},
function () {

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-select-native',
'GhSelectNativeComponent',
'Unit: Component: gh-select-native',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-spin-button',
'GhSpinButtonComponent',
'Unit: Component: gh-spin-button',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -4,37 +4,44 @@ import {
it
} from 'ember-mocha';
describeComponent('gh-trim-focus-input', function () {
it('trims value on focusOut', function () {
var component = this.subject({
value: 'some random stuff '
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');
});
this.render();
it('does not have the autofocus attribute if not set to focus', function () {
var component = this.subject({
value: 'some text',
focus: false
});
component.$().focusout();
expect(component.$().val()).to.equal('some random stuff');
});
this.render();
it('does not have the autofocus attribute if not set to focus', function () {
var component = this.subject({
value: 'some text',
focus: false
expect(component.$().attr('autofocus')).to.not.be.ok;
});
this.render();
it('has the autofocus attribute if set to focus', function () {
var component = this.subject({
value: 'some text',
focus: true
});
expect(component.$().attr('autofocus')).to.not.be.ok;
});
this.render();
it('has the autofocus attribute if set to focus', function () {
var component = this.subject({
value: 'some text',
focus: true
expect(component.$().attr('autofocus')).to.be.ok;
});
this.render();
expect(component.$().attr('autofocus')).to.be.ok;
});
});
}
);

View File

@ -3,7 +3,12 @@ import {
it
} from 'ember-mocha';
describeComponent('gh-url-preview',
describeComponent(
'gh-url-preview',
'Unit: Component: gh-url-preview',
{
unit: true
},
function () {
it('generates the correct preview URL with a prefix', function () {
var component = this.subject({

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-user-active',
'GhUserActiveComponent',
'Unit: Component: gh-user-active',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -7,8 +7,9 @@ import {
describeComponent(
'gh-user-invited',
'GhUserInvitedComponent',
'Unit: Component: gh-user-invited',
{
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
},

View File

@ -6,6 +6,7 @@ import {
describeModule(
'controller:post-settings-menu',
'Unit: Controller: post-settings-menu',
{
needs: ['controller:application', 'service:notifications']
},

View File

@ -6,6 +6,7 @@ import {
describeModule(
'controller:settings/general',
'Unit: Controller: settings/general',
{
needs: ['service:notifications']
},

View File

@ -19,7 +19,7 @@ var navSettingJSON = `[
describeModule(
'controller:settings/navigation',
'Unit : Controller : settings/navigation',
'Unit: Controller: settings/navigation',
{
// Specify the other units that are required for this test.
needs: ['service:config', 'service:notifications']

View File

@ -6,7 +6,7 @@ import {
ghUserCanAdmin
} from 'ghost/helpers/gh-user-can-admin';
describe ('GhUserCanAdminHelper', function () {
describe ('Unit: Helper: gh-user-can-admin', function () {
// Mock up roles and test for truthy
describe ('Owner role', function () {
var user = {get: function (role) {

View File

@ -8,7 +8,7 @@ import {
isEqual
} from 'ghost/helpers/is-equal';
describe('IsEqualHelper', function () {
describe('Unit: Helper: is-equal', function () {
// Replace this with your real tests.
it('works', function () {
var result = isEqual([42, 42]);

View File

@ -8,7 +8,7 @@ import {
isNot
} from 'ghost/helpers/is-not';
describe('IsNotHelper', function () {
describe('Unit: Helper: is-not', function () {
// Replace this with your real tests.
it('works', function () {
var result = isNot(false);

View File

@ -7,7 +7,7 @@ import {
import {readPath} from 'ghost/helpers/read-path';
import Ember from 'ember';
describe('ReadPathHelper', function () {
describe('Unit: Helper: read-path', function () {
// Replace this with your real tests.
it('works', function () {
var result = readPath([Ember.Object.create({hi: 'there'}), 'hi']);

View File

@ -7,7 +7,7 @@ import {
import Ember from 'ember';
import InfiniteScrollMixin from 'ghost/mixins/infinite-scroll';
describe('InfiniteScrollMixin', function () {
describe('Unit: Mixin: infinite-scroll', function () {
// Replace this with your real tests.
it('works', function () {
var InfiniteScrollObject = Ember.Object.extend(InfiniteScrollMixin),

View File

@ -4,7 +4,9 @@ import {
it
} from 'ember-mocha';
describeModel('post',
describeModel(
'post',
'Unit: Model: post',
{
needs:['model:user', 'model:tag', 'model:role']
},

View File

@ -4,7 +4,7 @@ import {
it
} from 'ember-mocha';
describeModel('role', function () {
describeModel('role', 'Unit: Model: role', function () {
it('provides a lowercase version of the name', function () {
var model = this.subject({
name: 'Author'

View File

@ -3,7 +3,7 @@ import {
it
} from 'ember-mocha';
describeModel('setting', function () {
describeModel('setting', 'Unit: Model: setting', function () {
it('has a validation type of "setting"', function () {
var model = this.subject();

View File

@ -3,7 +3,7 @@ import {
it
} from 'ember-mocha';
describeModel('tag', function () {
describeModel('tag', 'Unit: Model: tag', function () {
it('has a validation type of "tag"', function () {
var model = this.subject();

View File

@ -4,7 +4,9 @@ import {
it
} from 'ember-mocha';
describeModel('user',
describeModel(
'user',
'Unit: Model: user',
{
needs: ['model:role']
},

View File

@ -9,7 +9,7 @@ import Ember from 'ember';
describeModule(
'service:config',
'ConfigService',
'Unit: Service: config',
{
// Specify the other units that are required for this test.
// needs: ['service:foo']

View File

@ -9,7 +9,7 @@ import {
describeModule(
'service:notifications',
'NotificationsService',
'Unit: Service: notifications',
{
// Specify the other units that are required for this test.
// needs: ['model:notification']

View File

@ -1,6 +1,6 @@
import ghostPaths from 'ghost/utils/ghost-paths';
describe('ghost-paths', function () {
describe('Unit: Util: ghost-paths', function () {
describe('join', function () {
var join = ghostPaths().url.join;

View File

@ -32,7 +32,7 @@ testValidUrl = function (url) {
expect(navItem.get('hasValidated')).to.include('url');
};
describe('Unit : Validator : nav-item', function () {
describe('Unit: Validator: nav-item', function () {
it('requires label presence', function () {
let navItem = NavItem.create();