1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 10:51:44 +02:00

Cypress tests for examples (#4389)

* cypress: mentions example test

* cypress: search highlighting test

* cypress: tables example test

* cypress: check html in richtext

* Update cypress/integration/mentions.ts

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>

* Update cypress/integration/search-highlighting.ts

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>

* cypress: reset page before each test case

* cypress: Custom command dataCy

* cypress: seperate directory for examples' tests

* cypress: remove comments

* cypress: add placeholder test

* cypress: add plain text test

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>
This commit is contained in:
Samarjeet
2021-08-04 01:49:46 +05:30
committed by GitHub
parent 97b280926c
commit fed9354764
9 changed files with 99 additions and 2 deletions

View File

@@ -120,6 +120,7 @@ const MentionExample = () => {
borderRadius: '4px',
boxShadow: '0 1px 5px rgba(0,0,0,.2)',
}}
data-cy="mentions-portal"
>
{chars.map((char, i) => (
<div
@@ -181,6 +182,7 @@ const Mention = ({ attributes, children, element }) => {
<span
{...attributes}
contentEditable={false}
data-cy={`mention-${element.character.replace(' ', '-')}`}
style={{
padding: '3px 3px 2px',
margin: '0 1px',

View File

@@ -75,6 +75,7 @@ const Leaf = ({ attributes, children, leaf }) => {
return (
<span
{...attributes}
{...(leaf.highlight && { 'data-cy': 'search-highlighted' })}
className={css`
font-weight: ${leaf.bold && 'bold'};
background-color: ${leaf.highlight && '#ffeeba'};