-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/metric_explosion_grafana
- Loading branch information
Showing
184 changed files
with
16,114 additions
and
1,606 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
REPORTER ?= spec | ||
NODE_BIN := $(shell npm bin) | ||
MOCHA ?= ../../../node_modules/.bin/mocha | ||
BASE_DIR := $(NODE_BIN)/../.. | ||
NODE_PATH := test:$(BASE_DIR)/client | ||
|
||
test: | ||
@NODE_ENV=test NODE_PATH=$(NODE_PATH) $(MOCHA) --compilers jsx:babel/register --reporter $(REPORTER) | ||
|
||
.PHONY: test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
require( 'lib/react-test-env-setup' )(); | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
import { assert } from 'chai'; | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import sinon from 'sinon'; | ||
|
||
describe( 'ButtonGroup', function() { | ||
let sandbox, ButtonGroup, Button; | ||
beforeEach( function() { | ||
sandbox = sinon.sandbox.create(); | ||
sandbox.stub( console, 'error'); | ||
sandbox.stub( console, 'log'); | ||
|
||
ButtonGroup = require( '../index' ); | ||
Button = require( 'components/button' ); | ||
} ); | ||
|
||
afterEach( function() { | ||
sandbox.restore(); | ||
}) | ||
|
||
it( 'should have ButtonGroup class', function() { | ||
const buttonGroup = shallow( <ButtonGroup /> ); | ||
assert.equal( 1, buttonGroup.find( '.button-group' ).length ); | ||
} ); | ||
|
||
it( 'should contains the same number of .button nodes than <Button>s it receives', function() { | ||
const buttonGroup = shallow( <ButtonGroup><Button>test</Button><Button>test2</Button></ButtonGroup> ); | ||
assert.equal( 2, buttonGroup.find( Button ).length ); | ||
} ); | ||
|
||
it( 'should throw an error if any of the children is not a <Button>', function() { | ||
const buttonGroup = ( | ||
<ButtonGroup><div id="test">test</div></ButtonGroup> | ||
); | ||
sinon.assert.calledWithExactly( console.error, 'Warning: Failed propType: All children elements should be a Button.' ); | ||
} ); | ||
} ); |
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
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
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
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
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
Oops, something went wrong.