SpartaSystems / holdmail

HoldMail is a Java Application for proxying SMTP mail, providing a browsable viewer for captured emails.
Apache License 2.0
32 stars 15 forks source link

displays error message if not a valid email #51

Closed franz-see closed 6 years ago

franz-see commented 6 years ago
Question/Issue Overview

Build fail on gradle build. Specifically, on client's npm test.

Expected Behavior

Build success

Current Behavior
<details>
 <summary>Build Output</summary>
$ npm test

> holdmail-ui-vue@1.0.0 test ~/src/public/holdmail/client
> npm run lint && npm run unit

> holdmail-ui-vue@1.0.0 lint ~/src/public/holdmail/client
> eslint --ext .js,.vue src test/unit/specs test/e2e/specs

> holdmail-ui-vue@1.0.0 unit ~/src/public/holdmail/client
> cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run --browsers ChromeHeadless

06 12 2017 20:07:55.122:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
06 12 2017 20:07:55.134:INFO [launcher]: Launching browser ChromeHeadless with unlimited concurrency
06 12 2017 20:07:55.181:INFO [launcher]: Starting browser ChromeHeadless
06 12 2017 20:07:55.917:INFO [HeadlessChrome 0.0.0 (Mac OS X 10.13.1)]: Connected on socket zLLhvmoDTtden2enAAAA with id 16536938
INFO LOG: 'Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools'

  messages api
    ✓ getMessageList()
    ✓ getMessageDetail()
    ✓ forwardMessage()
    ✓ getMessageRAWEndpoint()

  MessageDetail.vue
    Lifecycle
      ✓ fetches message details on mount
    Rendering
      ✓ displays the message subject in the modal header
      ✓ displays three tabs
      ✓ if no message body html, disables the tab
      ✓ if no message body text, disables the tab
      tab selection
        ✓ should select html tab if html and text present
        ✓ should select html tab if html but no text present
        ✓ should select text tab if text but no html present
        ✓ should select original tab neither text nor html present
    Behavior
      Forwarding
        ✓ can forward an email to another address
ERROR LOG: '[Vue warn]: Error in nextTick: "TypeError: Cannot read property 'textContent' of null"

(found in <Root>)'
06 12 2017 20:07:56.845:WARN [web-server]: 404: /rest/messages/63/forward
ERROR LOG: TypeError{}
LOG LOG: 'Service failed to forward message to not valid email'
        Validation
          ✗ displays error message if not a valid email
    Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

  MessageTable.vue
    Lifecycle
      ✓ fetches messages on mount
    Rendering
      ✓ if no messages, display empty messages pane
      ✓ renders list of messages
      ✓ displays progress bar while busy fetching messages
    Behavior
      ✓ prevents simultaneous fetches of message list
      ✓ row click displays message details
      Searching
        ✓ search is initiated on enter key of search field
        ✓ search is initiated on clicking search button
        ✓ can filter search results by email

HeadlessChrome 0.0.0 (Mac OS X 10.13.1): Executed 24 of 24 (1 FAILED) (2.476 secs / 2.359 secs)
TOTAL: 1 FAILED, 23 SUCCESS

1) displays error message if not a valid email
     MessageDetail.vue Behavior Forwarding Validation
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

=============================== Coverage summary ===============================
Statements   : 92.42% ( 61/66 )
Branches     : 90.91% ( 20/22 )
Functions    : 71.43% ( 5/7 )
Lines        : 92.42% ( 61/66 )
================================================================================
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! holdmail-ui-vue@1.0.0 unit: `cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run --browsers ChromeHeadless`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the holdmail-ui-vue@1.0.0 unit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2017-12-06T12_07_59_177Z-debug.log
npm ERR! Test failed.  See above for more details.
</details>
Reproducible Sequence
  1. cd client
  2. npm test
barryoneill commented 6 years ago

Thank you for reporting this, not sure how a failing build in travis slipped under the radar! 😮

@tsneed290 and I have looked at this, and we're unable to reproduce locally so it's probably environmental. What OS are you using, out of curiosity?

tsneed290 commented 6 years ago

It looks like it came down to a timing issue with a validator plugin we're using. Apparently its asynchronous (doh).

Will put up a fix today.

tsneed290 commented 6 years ago

@franz-see fix has been merged, thanks for reporting the issue!

franz-see commented 6 years ago

Thanks for the quick turnaround! :) Verified to be fixed as of commit e93f0b13eafcb38c4f2b20af127799dd44382da1. Cheers