mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +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
43 lines
1.1 KiB
JavaScript
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/');
|
|
});
|
|
}
|
|
);
|