Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinicius Reis <vinicius.reis@nextcloud.com>2022-03-10 01:13:59 +0300
committerVinicius Reis <vinicius.reis@nextcloud.com>2022-03-14 17:38:29 +0300
commitafe74b4450781ecff2e10fa6bf8807c39212aec0 (patch)
tree9f4a036e29e785a4f124203446c6b932d2b2cb4e /cypress
parent0ee23b93d8cccbbf6e1725073cf9b4f8867cc353 (diff)
✅ (#2184): add callouts cypress tests
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/integration/workspace.spec.js65
1 files changed, 63 insertions, 2 deletions
diff --git a/cypress/integration/workspace.spec.js b/cypress/integration/workspace.spec.js
index 06ca947c5..85e616693 100644
--- a/cypress/integration/workspace.spec.js
+++ b/cypress/integration/workspace.spec.js
@@ -20,7 +20,6 @@
*
*/
-
import { randHash } from '../utils/'
const randUser = randHash()
@@ -57,7 +56,7 @@ describe('Workspace', function() {
['bold', 'strong'],
['italic', 'em'],
['underline', 'u'],
- ['strike', 's']
+ ['strike', 's'],
].forEach(([button, tag]) => {
menuButton(button)
.click()
@@ -152,6 +151,68 @@ describe('Workspace', function() {
cy.get('.empty-workspace').should('contain', 'Ajoutez des notes, listes ou liens')
})
+ describe('callouts', () => {
+ const types = ['info', 'warn', 'error', 'success']
+ it('create callouts', () => {
+ const workspace = openWorkspace()
+ workspace.type('Callout')
+
+ types.forEach(type => {
+ // enable callout
+ menuButton('info').click()
+ submenuButton(type).click()
+
+ // check if is active
+ menuButton(type).should('have.class', 'is-active')
+
+ // check content
+ cy.get(`.ProseMirror .callout.callout-${type}`)
+ .should('contain', 'Callout')
+
+ // disable
+ menuButton(type).click()
+ submenuButton(type).click()
+
+ // check if is inactive
+ menuButton('info').should('not.have.class', 'is-active')
+ })
+ })
+
+ it('toggle callouts', () => {
+ const workspace = openWorkspace()
+ workspace.type('Callout')
+
+ const [first, ...rest] = types
+
+ let last = first
+
+ // enable callout
+ menuButton('info').click()
+ submenuButton(first).click()
+
+ rest.forEach(type => {
+ // enable callout
+ menuButton(last).click()
+ submenuButton(type).click()
+
+ last = type
+
+ // check if is active
+ menuButton(type).should('have.class', 'is-active')
+
+ // check content
+ cy.get(`.ProseMirror .callout.callout-${type}`)
+ .should('contain', 'Callout')
+ })
+
+ // disable
+ menuButton(last).click()
+ submenuButton(last).click()
+
+ // check if is inactive
+ menuButton('info').should('not.have.class', 'is-active')
+ })
+ })
})
const menuButton = (name) => {