aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/tab.spec.js
AgeCommit message (Collapse)AuthorFilesLines
2024-02-06Build(deps-dev): Bump eslint-config-xo from 0.43.1 to 0.44.0 (#39651)dependabot[bot]1-1/+3
* Build(deps-dev): Bump eslint-config-xo from 0.43.1 to 0.44.0 Bumps [eslint-config-xo](https://github.com/xojs/eslint-config-xo) from 0.43.1 to 0.44.0. - [Release notes](https://github.com/xojs/eslint-config-xo/releases) - [Commits](https://github.com/xojs/eslint-config-xo/compare/v0.43.1...v0.44.0) --- updated-dependencies: - dependency-name: eslint-config-xo dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Update .eslintrc.json * Update .eslintrc.json * autofix --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: XhmikosR <[email protected]>
2023-07-23Support `Home` and `End` keys in tabs (#38498)Kyle Tsang1-0/+112
* Support `Home` and `End` keys in tabs * Update tab.js * simplify tests * Update navs-tabs.md * Update .bundlewatch.config.json --------- Co-authored-by: Patrick H. Lauke <[email protected]> Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2023-03-29Tweak and re-organize ESLint config (#38369)XhmikosR1-2/+2
* Tweak and re-organize ESLint config * merge individual configs to the root config * enable more eslint-plugin-import rules * lint markdown files * Lint
2023-03-14Fix wrong generation of `aria-labelledby` in tab navigation (#38223)Jan Bensch1-1/+1
* fix wrong generation of aria-labelledby in tab navigation * fix wrong test --------- Co-authored-by: Jan Bensch <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2022-11-12ESLint: enable prefer-template rule (#37484)XhmikosR1-1/+1
2022-11-07Properly escape IDs in getSelector() to handle weird IDs (#35565) (#35566)Pierre Souchay1-0/+37
2022-10-03Rename some vars in tab unit tests for consistency (#37248)Julien Déramond1-9/+9
2022-10-02Ensure Tab keyboard functionality after #37146 (#37200)GeoSot1-4/+30
* fix: keyboard functionality * test: add tests * Add some focus spies in 2 other unit tests Co-authored-by: Julien Déramond <[email protected]>
2022-09-23Tests: add testcase to Tabs, keyboard handler (#37189)GeoSot1-6/+13
2022-09-22Fix active class toggling of tabs within dropdown (#37151)Carson Sievert1-3/+4
* Close #36947: fix active class toggling tabs within dropdown
2022-09-20Drop tabs auto-focus (#37146)GeoSot1-2/+29
* fix: drop tabs auto-focus
2022-06-27ref(tab): remove show from panels dependent-less they have `.fade` class or ↵GeoSot1-2/+2
not (simplify checks) (#36622)
2022-05-31JS: tests fixes & standardization of spies usage (#36398)Louis-Maxime Piton1-46/+46
* Fix carousel spec typo * Change carousel test name in align with testing method * Make the spies declarations the same everywhere
2022-05-05Handle disabled focused tabs with tab JavaScript plugin (#36169)Julien Déramond1-0/+66
* Handle disabled tabs * Fix after feedback * Update js/src/tab.js Co-authored-by: GeoSot <[email protected]> * Update js/src/tab.js Co-authored-by: GeoSot <[email protected]> * Commit suggestions via GitHub broke the thing * Add some unit tests * Remove temp doc modification * Add tests for left arrow * Add disabled tabs in JavaScript Behavior section * Compact 4 tests to 2 tests * Compact 4 tests to 2 tests * Add 'disabled' attribute for all buttons * Change the disabled pane position only for the vertical version * Change ids for the confusing first example in JavaScript behavior * Use disabled attribute instead of the class for buttons in tabs Co-authored-by: GeoSot <[email protected]>
2022-04-06Revamp tabs & follow ARIA 1.1 practices (#33079)GeoSot1-29/+197
* Tab: Revamp tab.js & add support Aria features * Tab: Add tab support, just to keep backwards compatibility. Better to remove it on v6 * Revert "Tab: Add tab support, just to keep backwards compatibility. Better to remove it on v6" * Support arrow down/up functionality * add prevent default to avoid scrolling the page during up/down keys handling * remove panel tabindex handling * Expand documentation text for JS plugin * Rearrange new docs to specifically call out a11y * properly place section Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Patrick H. Lauke <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2022-02-19tests: revisit all tests using Promise.reject instead of throwing an error ↵GeoSot1-10/+10
(#35765)
2022-01-30tests: replace 'done' callback with 'Promise' to fix deprecation errors (#35659)GeoSot1-438/+476
Reference: https://jasmine.github.io/tutorials/async 'DEPRECATION: An asynchronous function called its 'done' callback more than once. This is a bug in the spec, beforeAll, beforeEach, afterAll, or afterEach function in question. This will be treated as an error in a future version. See<https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0#deprecations-due-to-calling-done-multiple-times> for more information.
2021-12-02Tests: Minor fixes (#35455)Louis-Maxime Piton1-1/+1
2021-12-01tests: remove extra spaces, unneeded arrays and add missing newlinesXhmikosR1-4/+14
2021-12-01tests: tweak Jasmine's matchers usageXhmikosR1-31/+31
Use: * toBeNull * toEqual * toBeTrue * toBeFalse * toHaveSize * toHaveClass
2021-10-08tests: minor cleanup (#35138)XhmikosR1-2/+0
* tests: minor cleanup * tests: use the util noop function
2021-07-30Enable a few eslint-config-xo rules (#34620)XhmikosR1-2/+2
* unicorn/prefer-dom-node-append * unicorn/prefer-dom-node-remove
2021-06-03Add `getOrCreateInstance` method in base-component (#33276)GeoSot1-0/+22
Co-authored-by: Rohit Sharma <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-05-11Remove potential false positive assertions (#33288)Ben Lertlumprasertkul1-1/+1
* 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 <[email protected]>
2021-04-21Dropdown: support `.dropdown-item` wrapped in `<li>` tags (#33634)Carson Sievert1-0/+22
Co-authored-by: XhmikosR <[email protected]>
2021-04-20Tab.js: Fixes on click handling (#33586)GeoSot1-52/+69
* use prevent default only if triggered by anchor * disable auto-initialization if trigger is disabled
2021-04-15Fix v5 regressions in tab dropdown functionality (#33626)Carson Sievert1-0/+35
Scope selector to `dropdownElement` when adding active classes
2021-03-17Dynamic tab should not show when triggered on `disabled` element (#33257)Patrick H. Lauke1-4/+30
* show() should bail if the trigger has `disabled` attribute * use 'isDisabled' helper Co-authored-by: GeoSot <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-02-22Allow constructors to accept a CSS selector (#32245)Rohit Sharma1-0/+16
Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2021-02-21Fix small typos / follow-up to #32630 (#33164)Patrick H. Lauke1-1/+1
2021-02-09Dynamic tabs: use buttons rather than links (#32630)Patrick H. Lauke1-50/+74
* 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-01-13Throw a `TypeError` instead of the generic `Error` (#32585)Rohit Sharma1-4/+2
* 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 <[email protected]>
2020-11-29Switch to Jasmine's `toBeInstanceOf` matcherXhmikosR1-1/+1
2020-11-29create a base componentJohann-S1-0/+1
2020-11-14Fix `.close` instances (#32152)XhmikosR1-3/+3
2020-11-14Add `bs` in data attributesRohit Sharma1-20/+20
- Add `bs` in data APIs everywhere - Update unit tests
2020-06-09Remove .nav-item from .nav-link to make it consistentRohit Sharma1-5/+5
- Closes #28423
2020-05-06tests: streamline HTML end tags (#30648)XhmikosR1-3/+9
2020-03-28v5 tabs - accessibility issue when using ul/li semanticLaussel Loïc1-17/+17
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
2019-10-09Rename "js/tests/units" to "js/tests/unit". (#29503)XhmikosR1-0/+593