mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 09:52:09 +03:00
Merge pull request #5921 from kevinansfield/standardise-test-names
Standardize ember test names and file names
This commit is contained in:
commit
b784ba0f4c
@ -9,7 +9,7 @@ const { run } = Ember;
|
||||
|
||||
describeComponent(
|
||||
'gh-navigation',
|
||||
'Integration : Component : gh-navigation',
|
||||
'Integration: Component: gh-navigation',
|
||||
{
|
||||
integration: true
|
||||
},
|
||||
|
@ -9,7 +9,7 @@ const { run } = Ember;
|
||||
|
||||
describeComponent(
|
||||
'gh-navitem',
|
||||
'Integration : Component : gh-navitem',
|
||||
'Integration: Component: gh-navitem',
|
||||
{
|
||||
integration: true
|
||||
},
|
||||
|
@ -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 () {
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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 () {
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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',
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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({
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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 () {
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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();
|
||||
|
@ -7,8 +7,9 @@ import {
|
||||
|
||||
describeComponent(
|
||||
'gh-search-input',
|
||||
'GhSearchInputComponent',
|
||||
'Unit: Component: gh-search-input',
|
||||
{
|
||||
unit: true,
|
||||
needs: ['component:gh-selectize']
|
||||
},
|
||||
function () {
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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;
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
@ -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({
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -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']
|
||||
},
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
|
||||
describeModule(
|
||||
'controller:post-settings-menu',
|
||||
'Unit: Controller: post-settings-menu',
|
||||
{
|
||||
needs: ['controller:application', 'service:notifications']
|
||||
},
|
@ -6,6 +6,7 @@ import {
|
||||
|
||||
describeModule(
|
||||
'controller:settings/general',
|
||||
'Unit: Controller: settings/general',
|
||||
{
|
||||
needs: ['service:notifications']
|
||||
},
|
@ -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']
|
||||
|
@ -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) {
|
||||
|
@ -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]);
|
||||
|
@ -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);
|
||||
|
@ -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']);
|
||||
|
@ -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),
|
||||
|
@ -4,7 +4,9 @@ import {
|
||||
it
|
||||
} from 'ember-mocha';
|
||||
|
||||
describeModel('post',
|
||||
describeModel(
|
||||
'post',
|
||||
'Unit: Model: post',
|
||||
{
|
||||
needs:['model:user', 'model:tag', 'model:role']
|
||||
},
|
@ -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'
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -4,7 +4,9 @@ import {
|
||||
it
|
||||
} from 'ember-mocha';
|
||||
|
||||
describeModel('user',
|
||||
describeModel(
|
||||
'user',
|
||||
'Unit: Model: user',
|
||||
{
|
||||
needs: ['model:role']
|
||||
},
|
@ -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']
|
||||
|
@ -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']
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user