Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-tabs-component

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tabs-component - npm Package Compare versions

Comparing version 1.0.9 to 1.1.0

26

__tests__/Tabs-test.js

@@ -154,2 +154,28 @@

it('Returning false from within willChange prevents tabs from changing',function(){
var willChange=function(){
return false;
};
var didChange=jest.genMockFunction();
var main=TestUtils.renderIntoDocument(
<Tabs
defaultTabNum={1}
tabNames={['Tab A','Tab B','Tab C']}
willChange={willChange}
didChange={didChange}
>
<section>Tab A Content</section>
<section>Tab B Content</section>
<section>Tab C Content</section>
</Tabs>
);
var tabB=TestUtils.scryRenderedDOMComponentsWithTag(main,'span')[1];
Simulate.click(tabB);
//var section=TestUtils.findRenderedDOMComponentWithTag(main,'section');
//expect(section.getDOMNode().textContent).toEqual('Tab C Content');
expect(didChange).not.toBeCalled();
});
it('Exposes `setActiveTabNum(num,callback)` and `getActiveTabNum()` public methods',function(){

@@ -156,0 +182,0 @@

2

package.json
{
"name": "react-tabs-component",
"version": "1.0.9",
"version": "1.1.0",
"description": "Tabs Component for React with the simplest API",

@@ -5,0 +5,0 @@ "keywords": [

@@ -90,3 +90,3 @@ # react-tabs-component #

- `willChange`—fires before the tab changes.
- `willChange`—fires before the tab changes. Return `false` from `willChange` to prevent the active tab from changing.
- `didChange`—fires after the tab changes.

@@ -93,0 +93,0 @@

@@ -42,4 +42,6 @@ var React=require('react/addons');

this.props.willChange(newActiveTabNum,oldActiveTabNum);
var allowChange=this.props.willChange(newActiveTabNum,oldActiveTabNum);
if (typeof allowChange !== 'undefined' && !allowChange){
return;
}
var callback=function(){

@@ -46,0 +48,0 @@ this.props.didChange(newActiveTabNum,oldActiveTabNum);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc