Ghost/ghost/admin/tests/unit/components/gh-url-preview_test.js
Kevin Ansfield 2f4f6db133 Use es6 across client and add ember-suave to enforce rules
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
2015-11-30 10:41:01 +00:00

43 lines
1.1 KiB
JavaScript

import {
describeComponent,
it
} from 'ember-mocha';
describeComponent(
'gh-url-preview',
'Unit: Component: gh-url-preview',
{
unit: true
},
function () {
it('generates the correct preview URL with a prefix', function () {
let component = this.subject({
prefix: 'tag',
slug: 'test-slug',
tagName: 'p',
classNames: 'test-class',
config: {blogUrl: 'http://my-ghost-blog.com'}
});
this.render();
expect(component.get('url')).to.equal('my-ghost-blog.com/tag/test-slug/');
});
it('generates the correct preview URL without a prefix', function () {
let component = this.subject({
slug: 'test-slug',
tagName: 'p',
classNames: 'test-class',
config: {blogUrl: 'http://my-ghost-blog.com'}
});
this.render();
expect(component.get('url')).to.equal('my-ghost-blog.com/test-slug/');
});
}
);