This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import OutsideClickHandler from 'react-outside-click-handler'; | |
const withOutsideClickHandler = (WrappedComponent) => class extends Component { | |
constructor(props) { | |
super(props); | |
this.ref = React.createRef(); | |
this.state = { | |
open: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import toJson from 'enzyme-to-json'; | |
// eslint-disable-next-line | |
import DummyComponent from './dir-to-dummy-component/DummyComponent'; | |
// eslint-disable-next-line | |
function shallow() { | |
const wrapper = shallow(<SeriesTabs />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Test Code */ | |
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import { createSerializer } from 'enzyme-to-json'; | |
// eslint-disable-next-line | |
import DummyComponent from '../component-dir/DummyComponent'; | |
// eslint-disable-next-line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { mount } from 'enzyme'; | |
import { Plot } from '../<InsertDirHere>'; | |
describe('Plot', () => { | |
describe('<Plot/> Component', () => { | |
const data = []; | |
const id = 'Chart_1'; | |
const layout = {}; | |
const afterDrawMock = jest.fn(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
export class Plot extends React.Component { | |
drawPlot() { | |
console.log('@@@@@@@@@@@@@ Called'); | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mount } from 'enzyme'; | |
import React from 'react'; | |
import EditableText from './../../../../../client/js/components/common/EditableText'; | |
describe('Search Page Component', () => { | |
const wrapper = mount( | |
<div className='somediv'> | |
<EditableText textValue=""> | |
<h1 id="TextLabel" title="" /> | |
</EditableText > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const merge = require('webpack-merge'); | |
const common = require('./webpack.config.common.js'); | |
const environment = 'development'; | |
const envParams = require('./webpack.params').getEnv(environment); | |
module.exports = merge(common, { | |
devtool: 'source-map', | |
devServer: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Component date range validator used abroad date applications | |
Receives a JSON Object dateControlValue with a dateFrom and dateTo, | |
Validates that one is greater dateTo is greater than dateFrom, if that happens then validateDateLimit triggers | |
an error message. If null is returned this means the validator won't display any message. | |
Original implementation by me. | |
*/ | |
validate(control: AbstractControl): { [key: string]: any } { | |
let dateControlValue = control.value; |