mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
✅ fix broken gh-image-uploader tests
This commit is contained in:
parent
0b867dfb89
commit
e143bce0b2
@ -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}}
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user