1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

fix broken gh-image-uploader tests

This commit is contained in:
Kevin Ansfield 2017-03-17 19:13:38 +02:00
parent 0ad27f493e
commit e87762c723
3 changed files with 6 additions and 5 deletions

View file

@ -15,7 +15,7 @@
{{!-- file selection/drag-n-drop --}}
<div class="upload-form">
{{#gh-file-input multiple=false alt=description action=(action "fileSelected") accept=accept}}
<div class="gh-btn gh-btn-outline"><span>{{description}}</span></div>
<div class="gh-btn gh-btn-outline" data-test-file-input-description><span>{{description}}</span></div>
{{/gh-file-input}}
</div>
{{/if}}

View file

@ -100,7 +100,7 @@ describe('Acceptance: Settings - General', function () {
click('.fullscreen-modal .modal-content .gh-image-uploader .image-cancel');
andThen(() => {
expect(find('.fullscreen-modal .modal-content .gh-image-uploader .description').text()).to.equal('Upload an image');
expect(find(testSelector('file-input-description')).text()).to.equal('Upload an image');
});
// click cancel button
@ -119,7 +119,7 @@ describe('Acceptance: Settings - General', function () {
click('.fullscreen-modal .modal-content .gh-image-uploader .image-cancel');
andThen(() => {
expect(find('.fullscreen-modal .modal-content .gh-image-uploader .description').text()).to.equal('Upload an image');
expect(find(testSelector('file-input-description')).text()).to.equal('Upload an image');
});
// click cancel button

View file

@ -11,6 +11,7 @@ import $ from 'jquery';
import run from 'ember-runloop';
import Service from 'ember-service';
import {UnsupportedMediaTypeError} from 'ghost-admin/services/ajax';
import testSelector from 'ember-test-selectors';
const notificationsStub = Service.extend({
showAPIError(/* error, options */) {
@ -72,12 +73,12 @@ describe('Integration: Component: gh-image-uploader', function() {
it('renders form with supplied alt text', function () {
this.render(hbs`{{gh-image-uploader image=image altText="text test"}}`);
expect(this.$('.description').text().trim()).to.equal('Upload image of "text test"');
expect(this.$(testSelector('file-input-description')).text().trim()).to.equal('Upload image of "text test"');
});
it('renders form with supplied text', function () {
this.render(hbs`{{gh-image-uploader image=image text="text test"}}`);
expect(this.$('.description').text().trim()).to.equal('text test');
expect(this.$(testSelector('file-input-description')).text().trim()).to.equal('text test');
});
it('generates request to correct endpoint', function (done) {