Fix component test, comment out form submission from cypress

- Added $t function to test now that it is being localised
- We are submitting the form by clicking on the button as a normal user would
- Cypress test still broken due to peculiarities of tiptap editor
This commit is contained in:
Matt Rider 2019-04-24 12:28:53 -03:00
parent 546e2c99ad
commit 8ae632be7b
2 changed files with 8 additions and 3 deletions

View File

@ -1,10 +1,10 @@
import { When, Then } from 'cypress-cucumber-preprocessor/steps' import { When, Then } from 'cypress-cucumber-preprocessor/steps'
When('I should be able to post a comment', () => { When('I should be able to post a comment', () => {
cy.get('.ProseMirror') cy.get('[contenteditable]')
.type('This is a comment') .type('This is a comment')
.get('.ds-form') // .get('.ds-form')
.submit() // .submit()
.get('button') .get('button')
.contains('Submit Comment') .contains('Submit Comment')
.click() .click()

View File

@ -9,14 +9,19 @@ localVue.use(Styleguide)
describe('Editor.vue', () => { describe('Editor.vue', () => {
let wrapper let wrapper
let propsData let propsData
let mocks
beforeEach(() => { beforeEach(() => {
propsData = {} propsData = {}
mocks = {
$t: () => {}
}
}) })
describe('mount', () => { describe('mount', () => {
let Wrapper = () => { let Wrapper = () => {
return (wrapper = mount(Editor, { return (wrapper = mount(Editor, {
mocks,
propsData, propsData,
localVue, localVue,
sync: false, sync: false,