From 8ae632be7b86a19c594b5a46b6212a5266073023 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Wed, 24 Apr 2019 12:28:53 -0300 Subject: [PATCH] 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 --- cypress/integration/common/post.js | 6 +++--- webapp/components/Editor/spec.js | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cypress/integration/common/post.js b/cypress/integration/common/post.js index 01601437c..63df8459b 100644 --- a/cypress/integration/common/post.js +++ b/cypress/integration/common/post.js @@ -1,10 +1,10 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps' When('I should be able to post a comment', () => { - cy.get('.ProseMirror') + cy.get('[contenteditable]') .type('This is a comment') - .get('.ds-form') - .submit() + // .get('.ds-form') + // .submit() .get('button') .contains('Submit Comment') .click() diff --git a/webapp/components/Editor/spec.js b/webapp/components/Editor/spec.js index d6659ef04..3e1784ed7 100644 --- a/webapp/components/Editor/spec.js +++ b/webapp/components/Editor/spec.js @@ -9,14 +9,19 @@ localVue.use(Styleguide) describe('Editor.vue', () => { let wrapper let propsData + let mocks beforeEach(() => { propsData = {} + mocks = { + $t: () => {} + } }) describe('mount', () => { let Wrapper = () => { return (wrapper = mount(Editor, { + mocks, propsData, localVue, sync: false,