Skip to content

Commit

Permalink
Migrate to vue 3
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Nov 16, 2023
1 parent fb98fc6 commit 9a5336e
Show file tree
Hide file tree
Showing 28 changed files with 250 additions and 353 deletions.
5 changes: 0 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ module.exports = {
plugins: [
'cypress',
],
ignorePatterns: [
'src/components/NcAppSidebar*/*.vue',
'src/components/NcDashboard*/*.vue',
'src/components/NcRich*/**/*.vue',
],
parserOptions: {
babelOptions: {
plugins: [
Expand Down
82 changes: 41 additions & 41 deletions cypress/component/richtext.cy.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Markdown guide: https://www.markdownguide.org/basic-syntax/
// Reference tests: https://github.com/nextcloud-deps/CDMarkdownKit/tree/master/CDMarkdownKitTests

import { mount } from 'cypress/vue2'
import { mount } from 'cypress/vue'
import NcRichText from '../../src/components/NcRichText/NcRichText.vue'

describe('NcRichText', () => {
describe('renders with markdown', () => {
describe('normal text', () => {
it('XML-like text (escaped and unescaped)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '<span>text&lt;/span&gt;',
useMarkdown: true,
},
Expand All @@ -31,7 +31,7 @@ describe('NcRichText', () => {
]

mount(NcRichText, {
propsData: {
props: {
text: testCases.map(i => i.input).join('\n'),
useMarkdown: true,
},
Expand All @@ -44,7 +44,7 @@ describe('NcRichText', () => {

it('ignored heading (with hash (#) syntax padded to the text)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '#heading',
useMarkdown: true,
},
Expand All @@ -55,7 +55,7 @@ describe('NcRichText', () => {

it('heading 1 (with equal (=) syntax on the next line)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'heading 1\n==',
useMarkdown: true,
},
Expand All @@ -66,7 +66,7 @@ describe('NcRichText', () => {

it('heading 2 (with dash (-) syntax on the next line)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'heading 2\n--',
useMarkdown: true,
},
Expand All @@ -79,7 +79,7 @@ describe('NcRichText', () => {
describe('bold text', () => {
it('bold text (single with asterisk syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '**bold asterisk**',
useMarkdown: true,
},
Expand All @@ -90,7 +90,7 @@ describe('NcRichText', () => {

it('bold text (single with underscore syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '__bold underscore__',
useMarkdown: true,
},
Expand All @@ -102,7 +102,7 @@ describe('NcRichText', () => {
it('bold text (several in line with different syntax)', () => {
const outputs = ['bold underscore', 'bold asterisk']
mount(NcRichText, {
propsData: {
props: {
text: 'normal text __bold underscore__ normal text **bold asterisk** normal text',
useMarkdown: true,
},
Expand All @@ -116,7 +116,7 @@ describe('NcRichText', () => {

it('bold text (between normal texts with asterisk syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'text**bold**text',
useMarkdown: true,
},
Expand All @@ -127,7 +127,7 @@ describe('NcRichText', () => {

it('ignored bold text (between normal texts with underscore syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'text__bold__text',
useMarkdown: true,
},
Expand All @@ -139,7 +139,7 @@ describe('NcRichText', () => {
it('normal text (between bold texts with asterisk syntax)', () => {
const outputs = ['bold asterisk', 'bold asterisk']
mount(NcRichText, {
propsData: {
props: {
text: '**bold asterisk**normal text**bold asterisk**',
useMarkdown: true,
},
Expand All @@ -155,7 +155,7 @@ describe('NcRichText', () => {
describe('italic text', () => {
it('italic text (single with asterisk syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '*italic asterisk*',
useMarkdown: true,
},
Expand All @@ -166,7 +166,7 @@ describe('NcRichText', () => {

it('italic text (single with underscore syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '_italic underscore_',
useMarkdown: true,
},
Expand All @@ -178,7 +178,7 @@ describe('NcRichText', () => {
it('italic text (several in line with different syntax)', () => {
const outputs = ['italic underscore', 'italic asterisk']
mount(NcRichText, {
propsData: {
props: {
text: 'normal text _italic underscore_ normal text *italic asterisk* normal text',
useMarkdown: true,
},
Expand All @@ -192,7 +192,7 @@ describe('NcRichText', () => {

it('italic text (between normal texts with asterisk syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'text*italic*text',
useMarkdown: true,
},
Expand All @@ -203,7 +203,7 @@ describe('NcRichText', () => {

it('ignored italic text (between normal texts with underscore syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'text_italic_text',
useMarkdown: true,
},
Expand All @@ -215,7 +215,7 @@ describe('NcRichText', () => {
it('normal text (between italic texts with asterisk syntax)', () => {
const outputs = ['italic asterisk', 'italic asterisk']
mount(NcRichText, {
propsData: {
props: {
text: '*italic asterisk*normal text*italic asterisk*',
useMarkdown: true,
},
Expand All @@ -231,7 +231,7 @@ describe('NcRichText', () => {
describe('inline code', () => {
it('inline code (single with backticks syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'normal text `inline code` normal text',
useMarkdown: true,
},
Expand All @@ -242,7 +242,7 @@ describe('NcRichText', () => {

it('inline code (single with double backticks syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'normal text ``inline code`` normal text',
useMarkdown: true,
},
Expand All @@ -253,7 +253,7 @@ describe('NcRichText', () => {

it('inline code (single with triple backticks syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'normal text ```inline code``` normal text',
useMarkdown: true,
},
Expand All @@ -265,7 +265,7 @@ describe('NcRichText', () => {
it('inline code (several in line )', () => {
const outputs = ['inline code 1', 'inline code 2']
mount(NcRichText, {
propsData: {
props: {
text: 'normal text `inline code 1`normal text ``inline code 2`` normal text',
useMarkdown: true,
},
Expand All @@ -279,7 +279,7 @@ describe('NcRichText', () => {

it('inline code (between normal texts)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'text`inline code`text',
useMarkdown: true,
},
Expand All @@ -290,7 +290,7 @@ describe('NcRichText', () => {

it('inline code (with ignored bold, italic, XML-like syntax))', () => {
mount(NcRichText, {
propsData: {
props: {
text: '`inline code **bold text** _italic text_ <span>text&lt;/span&gt;`',
useMarkdown: true,
},
Expand All @@ -303,7 +303,7 @@ describe('NcRichText', () => {
describe('multiline code', () => {
it('multiline code (with triple backticks syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '```\nmultiline code\n```',
useMarkdown: true,
},
Expand All @@ -314,7 +314,7 @@ describe('NcRichText', () => {

it('multiline code (ignored info)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '```vue\nmultiline code\n```',
useMarkdown: true,
},
Expand All @@ -325,7 +325,7 @@ describe('NcRichText', () => {

it('empty multiline code', () => {
mount(NcRichText, {
propsData: {
props: {
text: '``````',
useMarkdown: true,
},
Expand All @@ -336,7 +336,7 @@ describe('NcRichText', () => {

it('empty multiline code (with new line)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '```\n```',
useMarkdown: true,
},
Expand All @@ -347,7 +347,7 @@ describe('NcRichText', () => {

it('multiline code (with several lines)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '```\nline 1\nline 2\nline 3\n```',
useMarkdown: true,
},
Expand All @@ -359,7 +359,7 @@ describe('NcRichText', () => {

it('multiline code (with ignored bold, italic, inline code, XML-like syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '```\n**bold text**\n_italic text_\n`inline code`\n<span>text&lt;/span&gt;\n```',
useMarkdown: true,
},
Expand All @@ -372,7 +372,7 @@ describe('NcRichText', () => {
describe('blockquote', () => {
it('blockquote (with greater then (>) syntax - normal)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '> blockquote',
useMarkdown: true,
},
Expand All @@ -383,7 +383,7 @@ describe('NcRichText', () => {

it('blockquote (with greater then (&gt;) syntax - escaped)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '&gt; blockquote',
useMarkdown: true,
},
Expand All @@ -394,7 +394,7 @@ describe('NcRichText', () => {

it('blockquote (with bold, italic text, inline code)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '> blockquote **bold text** _italic text_ `inline code`',
useMarkdown: true,
},
Expand All @@ -408,7 +408,7 @@ describe('NcRichText', () => {

it('blockquote (with several lines)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '> line 1\nline 2\n line 3',
useMarkdown: true,
},
Expand All @@ -419,7 +419,7 @@ describe('NcRichText', () => {

it('blockquote (divided from normal text)', () => {
mount(NcRichText, {
propsData: {
props: {
text: 'normal text\n> line 1\nline 2\n\nnormal text',
useMarkdown: true,
},
Expand All @@ -430,7 +430,7 @@ describe('NcRichText', () => {

it('blockquote (with several paragraphs)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '> line 1\n>\n> line 3',
useMarkdown: true,
},
Expand All @@ -441,7 +441,7 @@ describe('NcRichText', () => {

it('blockquote (with nested blockquote)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '> blockquote\n>\n>> nested blockquote',
useMarkdown: true,
},
Expand All @@ -460,7 +460,7 @@ describe('NcRichText', () => {
]

mount(NcRichText, {
propsData: {
props: {
text: testCases.map(i => i.input).join('\n'),
useMarkdown: true,
},
Expand All @@ -481,7 +481,7 @@ describe('NcRichText', () => {
]

mount(NcRichText, {
propsData: {
props: {
text: testCases.map(i => i.input).join('\n'),
useMarkdown: true,
},
Expand All @@ -502,7 +502,7 @@ describe('NcRichText', () => {
]

mount(NcRichText, {
propsData: {
props: {
text: testCases.map(i => i.input).join('\n'),
useMarkdown: true,
},
Expand All @@ -518,7 +518,7 @@ describe('NcRichText', () => {
describe('dividers', () => {
it('dividers (with different syntax)', () => {
mount(NcRichText, {
propsData: {
props: {
text: '***\n---\n___',
useMarkdown: true,
},
Expand Down
Loading

0 comments on commit 9a5336e

Please sign in to comment.