-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fe27bd
commit 2a04030
Showing
6 changed files
with
107 additions
and
18 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
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,78 @@ | ||
import { parseTestTypebot } from 'cypress/plugins/utils' | ||
import { StepType } from 'models' | ||
|
||
describe('Text bubbles', () => { | ||
beforeEach(() => { | ||
cy.task('seed') | ||
cy.task( | ||
'createTypebot', | ||
parseTestTypebot({ | ||
id: 'typebot3', | ||
name: 'Typebot #3', | ||
ownerId: 'test2', | ||
steps: { | ||
byId: { | ||
step1: { | ||
id: 'step1', | ||
blockId: 'block1', | ||
type: StepType.TEXT, | ||
content: { html: '', plainText: '', richText: [] }, | ||
}, | ||
}, | ||
allIds: ['step1'], | ||
}, | ||
blocks: { | ||
byId: { | ||
block1: { | ||
id: 'block1', | ||
graphCoordinates: { x: 400, y: 200 }, | ||
title: 'Block #1', | ||
stepIds: ['step1'], | ||
}, | ||
}, | ||
allIds: ['block1'], | ||
}, | ||
}) | ||
) | ||
cy.signOut() | ||
}) | ||
|
||
it('rich text features should work', () => { | ||
cy.signIn('test2@gmail.com') | ||
cy.visit('/typebots/typebot3/edit') | ||
cy.findByTestId('bold-button').click() | ||
cy.findByRole('textbox', { name: 'Text editor' }).type('Bold text{enter}') | ||
cy.findByTestId('bold-button').click() | ||
cy.findByTestId('italic-button').click() | ||
cy.findByRole('textbox', { name: 'Text editor' }).type('Italic text{enter}') | ||
cy.findByTestId('italic-button').click() | ||
cy.findByTestId('underline-button').click() | ||
cy.findByRole('textbox', { name: 'Text editor' }).type( | ||
'Underlined text{enter}' | ||
) | ||
cy.findByTestId('bold-button').click() | ||
cy.findByTestId('italic-button').click() | ||
cy.findByRole('textbox', { name: 'Text editor' }).type('Everything text') | ||
cy.findByRole('button', { name: 'Preview' }).click() | ||
getIframeBody() | ||
.get('span.slate-bold') | ||
.should('exist') | ||
.should('contain.text', 'Bold text') | ||
getIframeBody() | ||
.get('span.slate-italic') | ||
.should('exist') | ||
.should('contain.text', 'Italic text') | ||
getIframeBody() | ||
.get('span.slate-underline') | ||
.should('exist') | ||
.should('contain.text', 'Underlined text') | ||
}) | ||
}) | ||
|
||
const getIframeBody = () => { | ||
return cy | ||
.get('#typebot-iframe') | ||
.its('0.contentDocument.body') | ||
.should('not.be.empty') | ||
.then(cy.wrap) | ||
} |
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