test: add savvy example tests (#2043)

This commit is contained in:
Donovan Glover 2021-10-25 03:53:53 -04:00 committed by GitHub
parent ddc9ca8d4f
commit 57a5bed495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,5 +3,36 @@ context('/src/Examples/Savvy/Vue/', () => {
cy.visit('/src/Examples/Savvy/Vue/')
})
// TODO: Write tests
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.clearContent()
})
})
const tests = [
['(c)', '©'],
['->', '→'],
['>>', '»'],
['1/2', '½'],
['!=', '≠'],
['--', '—'],
['1x1', '1×1'],
[':-) ', '🙂'],
['<3 ', '❤️'],
['>:P ', '😜'],
]
tests.forEach(test => {
it(`should parse ${test[0]} correctly`, () => {
cy.get('.ProseMirror')
.type(test[0])
.should('contain', test[1])
})
})
it('should parse hex colors correctly', () => {
cy.get('.ProseMirror')
.type('#FD9170')
.find('.color')
})
})