0abe447551
refs https://github.com/TryGhost/Ghost/issues/7204, requires https://github.com/TryGhost/Ghost/pull/7209 - replaces theme dropdown with a table - adds theme upload modal - validates theme mime type - prevents upload of `casper.zip` (default Casper theme can't be overwritten) - warns if an upload will overwrite an existing theme - gives option of immediately activating the uploaded theme or closing after successful upload - adds theme activation link/action - adds theme download link/action - adds theme deletion modal - warns about no undo possibility - offers possibility to download theme - modifies mirage config to handle theme changes
38 lines
906 B
JavaScript
38 lines
906 B
JavaScript
/* jshint expr:true */
|
|
import { expect } from 'chai';
|
|
import {
|
|
describeModule,
|
|
it
|
|
} from 'ember-mocha';
|
|
import sinon from 'sinon';
|
|
|
|
describeModule(
|
|
'service:event-bus',
|
|
'Unit: Service: event-bus',
|
|
{},
|
|
function() {
|
|
it('works', function () {
|
|
let service = this.subject();
|
|
let eventHandler = sinon.spy();
|
|
|
|
service.subscribe('test-event', eventHandler);
|
|
|
|
service.publish('test-event', 'test');
|
|
|
|
service.unsubscribe('test-event', eventHandler);
|
|
|
|
service.publish('test-event', 'test two');
|
|
|
|
expect(
|
|
eventHandler.calledOnce,
|
|
'event handler only triggered once'
|
|
).to.be.true;
|
|
|
|
expect(
|
|
eventHandler.calledWith('test'),
|
|
'event handler was passed correct arguments'
|
|
).to.be.true;
|
|
});
|
|
}
|
|
);
|