-
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add cypress test for markdown links that they are build correctly
- Loading branch information
Showing
4 changed files
with
30 additions
and
2 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,13 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('Markdown links', () => { | ||
it('should be just #welcome and not contain attribute target="_blank"', () => { | ||
cy.visit('/story/src-components-markdownlinks-story-vue?variantId=_default') | ||
cy.get('#link-to-welcome').should('have.attr', 'href', '#welcome').should('not.have.attr', 'target') | ||
}) | ||
|
||
it('should have target="_blank" set when they external', () => { | ||
cy.visit('/story/src-components-markdownlinks-story-vue?variantId=_default') | ||
cy.get('#link-to-history').should('have.attr', 'href', 'https://histoire.dev/').should('have.attr', 'target', '_blank') | ||
}) | ||
}) |
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
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,15 @@ | ||
<template> | ||
<Story | ||
group="top" | ||
docs-only | ||
icon="carbon:bookmark" | ||
/> | ||
</template> | ||
|
||
<docs lang="md"> | ||
[Link to welcome header](#welcome){id="link-to-welcome"} | ||
|
||
# Welcome | ||
|
||
This is just a link to [Histoire.dev](https://histoire.dev/){id="link-to-history"}. | ||
</docs> |