Commit 63792707 authored by Douwe Maan's avatar Douwe Maan

Remove now-unnecessary md-preview class

parent 146b55c9
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
<div <div
v-show="previewMarkdown" v-show="previewMarkdown"
ref="markdown-preview" ref="markdown-preview"
class="md-preview js-vue-md-preview md-preview-holder" class="js-vue-md-preview md-preview-holder"
> >
<suggestions <suggestions
v-if="hasSuggestion" v-if="hasSuggestion"
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
<div <div
v-show="previewMarkdown" v-show="previewMarkdown"
ref="markdown-preview" ref="markdown-preview"
class="md-preview js-vue-md-preview md md-preview-holder" class="js-vue-md-preview md md-preview-holder"
v-html="markdownPreview" v-html="markdownPreview"
></div> ></div>
</template> </template>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
.md-write-holder .md-write-holder
= yield = yield
.md.md-preview-holder.js-md-preview.hide.md-preview{ data: { url: url } } .md.md-preview-holder.js-md-preview.hide{ data: { url: url } }
.referenced-commands.hide .referenced-commands.hide
- if referenced_users - if referenced_users
......
...@@ -70,7 +70,7 @@ describe 'Comments on personal snippets', :js do ...@@ -70,7 +70,7 @@ describe 'Comments on personal snippets', :js do
fill_in 'note[note]', with: 'This is **awesome**!' fill_in 'note[note]', with: 'This is **awesome**!'
find('.js-md-preview-button').click find('.js-md-preview-button').click
page.within('.new-note .md-preview') do page.within('.new-note .md-preview-holder') do
expect(page).to have_content('This is awesome!') expect(page).to have_content('This is awesome!')
expect(page).to have_selector('strong') expect(page).to have_selector('strong')
end end
......
...@@ -37,7 +37,7 @@ describe 'User creates snippet', :js do ...@@ -37,7 +37,7 @@ describe 'User creates snippet', :js do
dropzone_file Rails.root.join('spec', 'fixtures', 'banana_sample.gif') dropzone_file Rails.root.join('spec', 'fixtures', 'banana_sample.gif')
find('.js-md-preview-button').click find('.js-md-preview-button').click
page.within('#new_personal_snippet .md-preview') do page.within('#new_personal_snippet .md-preview-holder') do
expect(page).to have_content('My Snippet') expect(page).to have_content('My Snippet')
link = find('a.no-attachment-icon img[alt="banana_sample"]')['src'] link = find('a.no-attachment-icon img[alt="banana_sample"]')['src']
......
...@@ -5,7 +5,7 @@ import fieldComponent from '~/vue_shared/components/markdown/field.vue'; ...@@ -5,7 +5,7 @@ import fieldComponent from '~/vue_shared/components/markdown/field.vue';
function assertMarkdownTabs(isWrite, writeLink, previewLink, vm) { function assertMarkdownTabs(isWrite, writeLink, previewLink, vm) {
expect(writeLink.parentNode.classList.contains('active')).toEqual(isWrite); expect(writeLink.parentNode.classList.contains('active')).toEqual(isWrite);
expect(previewLink.parentNode.classList.contains('active')).toEqual(!isWrite); expect(previewLink.parentNode.classList.contains('active')).toEqual(!isWrite);
expect(vm.$el.querySelector('.md-preview').style.display).toEqual(isWrite ? 'none' : ''); expect(vm.$el.querySelector('.md-preview-holder').style.display).toEqual(isWrite ? 'none' : '');
} }
describe('Markdown field component', () => { describe('Markdown field component', () => {
...@@ -80,7 +80,9 @@ describe('Markdown field component', () => { ...@@ -80,7 +80,9 @@ describe('Markdown field component', () => {
previewLink.click(); previewLink.click();
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('.md-preview').textContent.trim()).toContain('Loading…'); expect(vm.$el.querySelector('.md-preview-holder').textContent.trim()).toContain(
'Loading…',
);
done(); done();
}); });
...@@ -90,7 +92,7 @@ describe('Markdown field component', () => { ...@@ -90,7 +92,7 @@ describe('Markdown field component', () => {
previewLink.click(); previewLink.click();
setTimeout(() => { setTimeout(() => {
expect(vm.$el.querySelector('.md-preview').innerHTML).toContain( expect(vm.$el.querySelector('.md-preview-holder').innerHTML).toContain(
'<p>markdown preview</p>', '<p>markdown preview</p>',
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment