Skip to content

Commit

Permalink
Issue148 - 0 children regression in dash==0.40.0 (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andre-Rivet committed Apr 11, 2019
1 parent 2c0169c commit d2d902b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- Fix regression for `children=0` case [#148](https://github.com/plotly/dash-renderer/issues/148)

## [0.22.0] - 2019-04-10
### Added
- Added support for clientside callbacks [#143](https://github.com/plotly/dash-renderer/pull/143)
Expand Down
2 changes: 1 addition & 1 deletion src/TreeContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const createContainer = component => isSimpleComponent(component) ?

class TreeContainer extends Component {
getChildren(components) {
if (!components) {
if (isNil(components)) {
return null;
}

Expand Down
22 changes: 21 additions & 1 deletion tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def request_queue_assertions(

if expected_length is not None:
self.assertEqual(len(request_queue), expected_length)

def test_initial_state(self):
app = Dash(__name__)
app.layout = html.Div([
Expand Down Expand Up @@ -475,6 +475,26 @@ def test_initial_state(self):

assert_clean_console(self)

def test_array_of_falsy_child(self):
app = Dash(__name__)
app.layout = html.Div(id='nully-wrapper', children=[0])

self.startServer(app)

self.wait_for_text_to_equal('#nully-wrapper', '0')

assert_clean_console(self)

def test_of_falsy_child(self):
app = Dash(__name__)
app.layout = html.Div(id='nully-wrapper', children=0)

self.startServer(app)

self.wait_for_text_to_equal('#nully-wrapper', '0')

assert_clean_console(self)

def test_simple_callback(self):
app = Dash(__name__)
app.layout = html.Div([
Expand Down

0 comments on commit d2d902b

Please sign in to comment.