Ghost/ghost/admin/tests/unit/components/gh-navitem-url-input-test.js

33 lines
830 B
JavaScript
Raw Normal View History

/* jshint expr:true */
import run from 'ember-runloop';
import {expect} from 'chai';
2016-11-24 01:50:57 +03:00
import {describe, it} from 'mocha';
import {setupComponentTest} from 'ember-mocha';
2016-11-24 01:50:57 +03:00
describe('Unit: Component: gh-navitem-url-input', function () {
setupComponentTest('gh-navitem-url-input', {
unit: true
2016-11-24 01:50:57 +03:00
});
2016-11-24 01:50:57 +03:00
it('identifies a URL as the base URL', function () {
let component = this.subject({
url: '',
baseUrl: 'http://example.com/'
});
2016-11-24 01:50:57 +03:00
this.render();
2016-11-24 01:50:57 +03:00
run(function () {
component.set('value', 'http://example.com/');
});
2016-11-24 01:50:57 +03:00
expect(component.get('isBaseUrl')).to.be.ok;
2016-11-24 01:50:57 +03:00
run(function () {
component.set('value', 'http://example.com/go/');
});
2016-11-24 01:50:57 +03:00
expect(component.get('isBaseUrl')).to.not.be.ok;
});
});