mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 13:41:04 +08:00
FEATURE: Replace composer editor with ember version
This commit is contained in:
@ -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() {
|
||||
|
Reference in New Issue
Block a user