mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 22:51:06 +08:00
Never show preview pane in composer on mobile.
This commit is contained in:
@ -187,4 +187,20 @@ test('initial category when uncategorized is not allowed', function() {
|
||||
Discourse.SiteSettings.allow_uncategorized_topics = false;
|
||||
var composer = Discourse.Composer.open({action: 'createTopic', draftKey: 'asfd', draftSequence: 1});
|
||||
ok(composer.get('categoryId') === undefined, "Uncategorized by default. Must choose a category.");
|
||||
});
|
||||
});
|
||||
|
||||
test('showPreview', function() {
|
||||
var new_composer = function() {
|
||||
return Discourse.Composer.open({action: 'createTopic', draftKey: 'asfd', draftSequence: 1});
|
||||
};
|
||||
|
||||
Discourse.Mobile.mobileView = true;
|
||||
equal(new_composer().get('showPreview'), false, "Don't show preview in mobile view");
|
||||
|
||||
Discourse.KeyValueStore.set({ key: 'composer.showPreview', value: 'true' });
|
||||
equal(new_composer().get('showPreview'), false, "Don't show preview in mobile view even if KeyValueStore wants to");
|
||||
Discourse.KeyValueStore.remove('composer.showPreview');
|
||||
|
||||
Discourse.Mobile.mobileView = false;
|
||||
equal(new_composer().get('showPreview'), true, "Show preview by default in desktop view");
|
||||
});
|
||||
|
Reference in New Issue
Block a user