-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app-store): Correctly render Markdown in app description
This seems to be broken by an update because the renderer now passes an object instead of multiple arguments to the render functions. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
- Loading branch information
Showing
3 changed files
with
74 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/*! | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import Markdown from './Markdown.vue' | ||
|
||
describe('Markdown component', () => { | ||
it('renders links', () => { | ||
cy.mount(Markdown, { | ||
propsData: { | ||
text: 'This is [a link](http://example.com)!', | ||
}, | ||
}) | ||
|
||
cy.contains('This is') | ||
.find('a') | ||
.should('exist') | ||
.and('have.attr', 'href', 'http://example.com') | ||
.and('contain.text', 'a link') | ||
}) | ||
|
||
it('renders headings', () => { | ||
cy.mount(Markdown, { | ||
propsData: { | ||
text: '# level 1\nText\n## level 2\nText\n### level 3\nText\n#### level 4\nText\n##### level 5\nText\n###### level 6\nText\n', | ||
}, | ||
}) | ||
|
||
for (let level = 1; level <= 6; level++) { | ||
cy.contains(`h${level}`, `level ${level}`) | ||
.should('be.visible') | ||
} | ||
}) | ||
|
||
it('can limit headings', () => { | ||
cy.mount(Markdown, { | ||
propsData: { | ||
text: '# level 1\nText\n## level 2\nText\n### level 3\nText\n#### level 4\nText\n##### level 5\nText\n###### level 6\nText\n', | ||
minHeading: 4, | ||
}, | ||
}) | ||
|
||
cy.get('h1').should('not.exist') | ||
cy.get('h2').should('not.exist') | ||
cy.get('h3').should('not.exist') | ||
cy.get('h4') | ||
.should('exist') | ||
.and('contain.text', 'level 1') | ||
cy.get('h5') | ||
.should('exist') | ||
.and('contain.text', 'level 2') | ||
cy.contains('h6', 'level 3').should('exist') | ||
cy.contains('h6', 'level 4').should('exist') | ||
cy.contains('h6', 'level 5').should('exist') | ||
cy.contains('h6', 'level 6').should('exist') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters