Skip to content

Commit 2644096

Browse files
committed
added a test and fixed a broken test
1 parent c852b44 commit 2644096

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/components/cylc/Info.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
7272
</dd>
7373
<v-divider />
7474
<dt>Description</dt>
75-
<dd><Markdown :markdown="taskMetadata.description"/></dd>
75+
<dd><Markdown :markdown="taskMetadata.description || ''"/></dd>
7676
<v-divider />
7777
<template v-for="(value, key) in customMetadata" :key="key">
7878
<dt><Markdown :markdown="'## ' + key"/></dt>

tests/component/specs/info.cy.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ import { Tokens } from '@/utils/uid'
2121
const DESCRIPTION = `Lorem ipsum dolor sit amet, consectetur adipiscing elit.
2222
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
2323
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.
24+
25+
# New Section
26+
27+
H{sub}\`2\`O, and 5{sup}\`th\` of November.
28+
29+
\`\`\`{list-table} A Liszt Table
30+
:header-rows: 1
31+
32+
* - Piece
33+
- Year
34+
* - Hungarian Rhapsody No. 2
35+
- 1847
36+
* - La Campanella
37+
- 1851
38+
* - Liebestraum No. 3
39+
- 1850
2440
`
2541
const TOKENS = new Tokens('~user/workflow//1234/foo')
2642
const TASK = {
@@ -155,6 +171,21 @@ describe('Info component', () => {
155171
.get('.metadata-panel a:first') // the URL should be an anchor
156172
.should('have.attr', 'href', 'https://cylc.org')
157173
.contains(/^https:\/\/cylc.org$/)
174+
// Markdonw allows the adding of additional titles:
175+
.get('h1').eq(1)
176+
.contains('New Section')
177+
// Markdown subscripts and superscripts should be rendered:
178+
.get('sub')
179+
.contains('2')
180+
.get('sup')
181+
.contains('th')
182+
// Markdown tables should be rendered:
183+
.get('table')
184+
.should('be.visible')
185+
.get('table tr')
186+
.contains('Hungarian Rhapsody No. 2')
187+
.get('table th')
188+
.contains('Piece')
158189

159190
// the prerequisites panel
160191
cy.get('.prerequisites-panel.v-expansion-panel--active').should('be.visible')

0 commit comments

Comments
 (0)