Skip to content

Commit

Permalink
Guard in test env
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed Jan 22, 2018
1 parent cb79d5d commit 75b05cf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
7 changes: 6 additions & 1 deletion desktop/apps/auction/components/DOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import mediator from 'desktop/lib/mediator.coffee'
import scrollToTop from 'desktop/apps/auction/utils/scrollToTop'
import { Component } from 'react'
import { connect } from 'react-redux'
import { data as sd } from 'sharify'

class DOM extends Component {
static propTypes = {
Expand All @@ -19,7 +20,11 @@ class DOM extends Component {

componentDidMount () {
const FastClick = require('fastclick')
FastClick.attach(document.body)

// removes 300ms delay
if (sd.NODE_ENV === 'test') {
FastClick.attach(document.body)
}

this.$ = require('jquery')
this.addEventListeners()
Expand Down
7 changes: 6 additions & 1 deletion desktop/apps/auctions2/components/DOM.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types'
import { Component } from 'react'
import { connect } from 'react-redux'
import { data as sd } from 'sharify'

class DOM extends Component {
static propTypes = {
Expand All @@ -13,7 +14,11 @@ class DOM extends Component {

componentDidMount () {
const FastClick = require('fastclick')
FastClick.attach(document.body)

// removes 300ms delay
if (sd.NODE_ENV === 'test') {
FastClick.attach(document.body)
}

this.$ = require('jquery')
this.addEventListeners()
Expand Down
5 changes: 3 additions & 2 deletions mobile/components/layout/bootstrap.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Cookies = require 'cookies-js'
{ parse } = require 'url'
HeaderView = require './client/header_view.coffee'
doc = window.document
sharify = require('sharify')

module.exports = ->
# Add the Gravity XAPP or access token to all ajax requests
Expand All @@ -30,9 +31,9 @@ module.exports = ->
Cookies.set 'inquiry-referrer', doc.referrer
Cookies.set 'inquiry-session-start', location.href


# removes 300ms delay
FastClick.attach document.body
# if sharify.data.NODE_ENV is 'development'
# FastClick.attach document.body

setupErrorReporting()
setupHeaderView()
Expand Down
1 change: 1 addition & 0 deletions test/test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path')

require('raf/polyfill')

// TODO: Look into why this bumps user off of other node command-line tab
require('dotenv').config({
path: path.join(process.cwd(), '.env.test')
})
Expand Down

0 comments on commit 75b05cf

Please sign in to comment.