FEATURE: Replace composer editor with ember version

This commit is contained in:
Robin Ward
2015-11-03 16:25:37 -05:00
parent fc27b7442f
commit 47495a5713
51 changed files with 771 additions and 3420 deletions

View File

@ -1,13 +1,10 @@
import { blank } from 'helpers/qunit-helpers';
import { currentUser } from 'helpers/qunit-helpers';
import KeyValueStore from 'discourse/lib/key-value-store';
import Composer from 'discourse/models/composer';
import createStore from 'helpers/create-store';
module("model:composer");
const keyValueStore = new KeyValueStore("_test_composer");
function createComposer(opts) {
opts = opts || {};
opts.user = opts.user || currentUser();
@ -185,22 +182,6 @@ test('initial category when uncategorized is not allowed', function() {
ok(!composer.get('categoryId'), "Uncategorized by default. Must choose a category.");
});
test('showPreview', function() {
const newComposer = function() {
return openComposer({action: 'createTopic', draftKey: 'asfd', draftSequence: 1});
};
Discourse.Mobile.mobileView = true;
equal(newComposer().get('showPreview'), false, "Don't show preview in mobile view");
keyValueStore.set({ key: 'composer.showPreview', value: 'true' });
equal(newComposer().get('showPreview'), false, "Don't show preview in mobile view even if KeyValueStore wants to");
keyValueStore.remove('composer.showPreview');
Discourse.Mobile.mobileView = false;
equal(newComposer().get('showPreview'), true, "Show preview by default in desktop view");
});
test('open with a quote', function() {
const quote = '[quote="neil, post:5, topic:413"]\nSimmer down you two.\n[/quote]';
const newComposer = function() {