Ver Fonte

Fix failing tests

Sergiu Miclea há 7 anos atrás
pai
commit
0662b56ca2
2 ficheiros alterados com 3 adições e 3 exclusões
  1. 1 1
      server/main.js
  2. 2 2
      src/components/organisms/LoginForm/test.jsx

+ 1 - 1
server/main.js

@@ -42,5 +42,5 @@ app.use((req, res) => {
 })
 
 app.listen(PORT, () => {
-  console.log(`Express server is up on port ${PORT}`) // eslint-disable-line no-console
+  console.log(`Express server is up on port ${PORT}`)
 })

+ 2 - 2
src/components/organisms/LoginForm/test.jsx

@@ -28,12 +28,12 @@ const wrap = props => new TW(shallow(
 describe('LoginForm Component', () => {
   it('renders incorrect credentials', () => {
     let wrapper = wrap({ loginFailedResponse: { status: 401 } })
-    expect(wrapper.findText('errorText')).toBe('The username or password did not match. Please try again.')
+    expect(wrapper.find('errorText').prop('dangerouslySetInnerHTML').__html).toBe('Incorrect credentials.<br />Please try again.') // eslint-disable-line
   })
 
   it('renders server error', () => {
     let wrapper = wrap({ loginFailedResponse: {} })
-    expect(wrapper.findText('errorText')).toBe('Request failed, there might be a problem with the connection to the server.')
+    expect(wrapper.find('errorText').prop('dangerouslySetInnerHTML').__html).toBe('Request failed, there might be a problem with the connection to the server.') // eslint-disable-line
   })
 
   it('submits correct info', () => {