mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
753681e9e9
no issue - standardize on "{TestType}: {ModuleType}: {module-name}" for test description strings - standardize on `{module-name}-test.js` for test file names - fix deprecation notices for ember component unit tests without explicit `unit: test` or `needs: []`
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 () {
|
|
var 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 () {
|
|
var 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/');
|
|
});
|
|
}
|
|
);
|