0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Commit Graph

20 Commits

Author SHA1 Message Date
XhmikosR
a260967a55
tests: minor cleanup (#35138)
* tests: minor cleanup

* tests: use the util noop function
2021-10-08 12:32:11 +03:00
XhmikosR
6d707f4801
Enable a few eslint-config-xo rules (#34620)
* unicorn/prefer-dom-node-append
* unicorn/prefer-dom-node-remove
2021-07-30 00:23:00 +02:00
GeoSot
c98657b830
Add getOrCreateInstance method in base-component (#33276)
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-06-03 18:53:27 +03:00
Ben Lertlumprasertkul
052def4568
Remove potential false positive assertions (#33288)
* Remove potential false positive assertions

querySelector() returns null but

expect(document.querySelector('...')).toBeDefined()

tests that the value is not undefined

* Migrated assertions from .toBeDefined() to .not.toBeNull() for .getInstance() calls in tests

* Migrate offcanvas assertions from .toBeDefined() to .not.toBeNull() for .getInstance() call

* convert more cases to not.toBeNull assertions

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-05-11 08:45:57 +03:00
Carson Sievert
2cbb0a941c
Dropdown: support .dropdown-item wrapped in <li> tags (#33634)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-04-21 08:30:19 +03:00
GeoSot
0bbe45cd97
Tab.js: Fixes on click handling (#33586)
* use prevent default only if triggered by anchor
* disable auto-initialization if trigger is disabled
2021-04-20 08:26:58 +03:00
Carson Sievert
69f5c0130b
Fix v5 regressions in tab dropdown functionality (#33626)
Scope selector to `dropdownElement` when adding active classes
2021-04-15 13:53:55 +03:00
Patrick H. Lauke
3ce0a8d3ec
Dynamic tab should not show when triggered on disabled element (#33257)
* show() should bail if the trigger has `disabled` attribute

* use 'isDisabled' helper

Co-authored-by: GeoSot <geo.sotis@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-17 10:52:40 +02:00
Rohit Sharma
dc5e3328c1
Allow constructors to accept a CSS selector (#32245)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <otto@github.com>
2021-02-22 09:01:04 +02:00
Patrick H. Lauke
5693f1ad86
Fix small typos / follow-up to #32630 (#33164) 2021-02-21 08:00:03 +02:00
Patrick H. Lauke
96be06e32b
Dynamic tabs: use buttons rather than links (#32630)
* Dynamic tabs: use buttons rather than links

- change docs
- add mention that tabs should be <button> elements
- tweak styles to neutralise border and background

* Update js unit and visual test accordingly

- replace links with buttons
- make one specific test that uses links instead of buttons, as we still want to support it despite it being non-semantically appropriate
- Leaving a couple of tests for now. The test for removed tabs should be redone so that tabs are removed programmatically (as the approach of having that close button inside the link is invalid and broken markup). The test for dropdowns should be removed together we actually ripping out the handling for dropdowns in the tab.js code (arguably a breaking change, though we discouraged this for a few versions and effectively "deprecated" it)

* Add isolation:isolate to prevent focus being overlapped

https://github.com/twbs/bootstrap/pull/32630#issuecomment-756015766
2021-02-09 07:23:45 +02:00
Rohit Sharma
c9cd741aff
Throw a TypeError instead of the generic Error (#32585)
* Change from Error to TypeError

* Convert the `NAME` to upper case to make the consistency in the error message

* Update the remaining tests to be stricter

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-13 22:13:30 +02:00
XhmikosR
51a208f119 Switch to Jasmine's toBeInstanceOf matcher 2020-11-29 20:58:26 +02:00
Johann-S
9f6b342dc7 create a base component 2020-11-29 20:58:26 +02:00
XhmikosR
4f8b243ac1
Fix .close instances (#32152) 2020-11-14 08:16:30 +02:00
Rohit Sharma
418f17ee2b Add bs in data attributes
- Add `bs` in data APIs everywhere
- Update unit tests
2020-11-14 07:09:15 +02:00
Rohit Sharma
e140ff92ed Remove .nav-item from .nav-link to make it consistent
- Closes #28423
2020-06-09 07:48:58 +03:00
XhmikosR
967e6071ba
tests: streamline HTML end tags (#30648) 2020-05-06 09:20:08 +03:00
Laussel Loïc
7ce29d75f3
v5 tabs - accessibility issue when using ul/li semantic
Add aria-role presentation on li element when ul element has role tablist and remove dropdown from visual tests as they've been removed from doc
2020-03-28 09:51:24 +02:00
XhmikosR
577bf8b14d
Rename "js/tests/units" to "js/tests/unit". (#29503) 2019-10-09 01:27:43 +03:00