-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Alert * Badge * Button * ButtonGroup * Carousel * Collapse * Fade * Add shim for html components that don't have class_name defined yet * Update block button docs * Update docs for Bootstrap 5 * RIP Jumbotron * Add react-bootstrap beta * Layout * Docs fix * Label * Clean up example * Monkeypatch doc tests * New components - Offcanvas and pagination (#643) * Added offcanvas components * Offcanvas doc snippets * Added offcanvas documentation * Fixed long text issue * Added react-bootstrap * Added offcanvas * Added offcanvas tests * Added js tests for offcanvas * Addition of new pagination component * Combined offcanvas into single component * Formatting * ABetter handling of pagination component * Updated pagination docs * Removed invalid code * Updated npm demo to Bootstrap 5 * Updated pagination docs to include R and jl * Updated pagination tests * Fixed callbacks * Reverted to 5.0.2 to avoid issues with offcanvas backdrop until resolved * Fixed offcanvas tests * Tidy up * Progress * Format tests * Spinner * Table * Toast * New component Accordion (#645) * Accordion component and js test * Added documentation for accordion * R and Julia examples * Fixed h2 formatting issues * Added accordion folder for flake8 * Update demo/Demo.js Co-authored-by: glsdown <52132406+glsdown@users.noreply.github.com> Co-authored-by: Tom Begley <tomcbegley@gmail.com> * flake8 config * List group updated to Bootstrap 5 (#647) * Updated list-group component * Updated list-group docs * Bug fixes * Tabs * Form * Form updates + examples * Checklist / RadioItems * Select * themes * BS5 updates for docs * Fix doc tests * InputGroup * Fix JS tests * Checkbox/Radio * format js * Modal * Modal docs * Fix format command * Card, Nav and Navbar (#648) * Monkeypatch doc tests * Card * Nav and NavBar Update to Collapse to remove navbar prop * fixed Card.test.js for Card body test * updated docs for Navbar example. Also updated julia and R snippets * updates to Navbar and Collapse after review * updated index for deleted NavbarCollapse * lint and black Co-authored-by: tcbegley <tomcbegley@gmail.com> * DropdownMenu * NavbarToggler * Tooltip+Popover * Consistent imports * Fix accordion tests * Initial breadcrumb component * Set accordion to first component * Format code * Update Breadcrumb * Snippet test fixes for breadcrumb * Popover - minor prop updates (#652) * Use size prop consistently Co-authored-by: glsdown <52132406+glsdown@users.noreply.github.com> Co-authored-by: AnnMarieW <72614349+AnnMarieW@users.noreply.github.com>
- Loading branch information
1 parent
d3be037
commit 8532982
Showing
360 changed files
with
6,044 additions
and
5,379 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
55 changes: 55 additions & 0 deletions
55
docs/components_page/components/__tests__/test_accordion.py
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,55 @@ | ||
""" | ||
Testing of callbacks in non-Python Accordion snippets. | ||
""" | ||
from pathlib import Path | ||
|
||
import dash.testing.wait as wait | ||
|
||
from .helpers import load_jl_app, load_r_app | ||
|
||
HERE = Path(__file__).parent | ||
|
||
|
||
def test_r_simple(dashr): | ||
r_app = load_r_app((HERE.parent / "accordion" / "simple.R"), "accordion") | ||
dashr.start_server(r_app) | ||
check_simple_callbacks(dashr) | ||
|
||
|
||
def test_jl_simple(dashjl): | ||
jl_app = load_jl_app( | ||
(HERE.parent / "accordion" / "simple.jl"), "accordion" | ||
) | ||
with open("app.jl", "w") as f: | ||
f.write(jl_app) | ||
dashjl.start_server(jl_app) | ||
check_simple_callbacks(dashjl) | ||
|
||
|
||
def check_simple_callbacks(runner): | ||
# Find the accordion object | ||
accordion_comp = runner.find_element("#accordion") | ||
accordion_text = runner.find_element("#accordion-contents") | ||
|
||
# Check it has 3 accordion-items in it | ||
items = accordion_comp.find_elements_by_class_name("accordion-item") | ||
wait.until( | ||
lambda: len(items) == 3, | ||
timeout=4, | ||
) | ||
|
||
# Click the third section | ||
items[2].find_element_by_class_name("accordion-button").click() | ||
|
||
# Check the text in contents changes to "Item selected: item-3" | ||
wait.until( | ||
lambda: accordion_text.text == "Item selected: item-3", | ||
timeout=4, | ||
) | ||
|
||
# Check that the right section is showing | ||
item = accordion_comp.find_element_by_class_name("show") | ||
wait.until( | ||
lambda: item.text == "This is the content of the third section", | ||
timeout=4, | ||
) |
Oops, something went wrong.