spec fixes

This commit is contained in:
Phil Hughes 2017-10-10 13:01:36 +01:00
parent 299da4ca07
commit def8b913ff
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
2 changed files with 4 additions and 6 deletions

View file

@ -40,7 +40,7 @@ export default class ShortcutsIssuable extends ShortcutsNavigation {
return false;
}
const quote = _.map(selected.split('\n'), val => `> ${val.trim()}\n`);
const quote = _.map(selected.split('\n'), val => `${(`> ${val}`).trim()}\n`);
// If replyField already has some content, add a newline before our quote
const separator = (this.$replyField.val().trim() !== '' && '\n\n') || '';

View file

@ -9,19 +9,17 @@ describe('Shortcuts', () => {
preloadFixtures(fixtureName);
describe('toggleMarkdownPreview', () => {
let sc;
beforeEach(() => {
loadFixtures(fixtureName);
spyOnEvent('.js-new-note-form .js-md-preview-button', 'focus');
spyOnEvent('.edit-note .js-md-preview-button', 'focus');
sc = new Shortcuts();
new Shortcuts(); // eslint-disable-line no-new
});
it('focuses preview button in form', () => {
sc.toggleMarkdownPreview(
Shortcuts.toggleMarkdownPreview(
createEvent('KeyboardEvent', document.querySelector('.js-new-note-form .js-note-text'),
));
@ -32,7 +30,7 @@ describe('Shortcuts', () => {
document.querySelector('.js-note-edit').click();
setTimeout(() => {
sc.toggleMarkdownPreview(
Shortcuts.toggleMarkdownPreview(
createEvent('KeyboardEvent', document.querySelector('.edit-note .js-note-text'),
));