aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/dropdown.spec.js
AgeCommit message (Collapse)AuthorFilesLines
2024-07-19Fix `this` reference for JavaScript functions (#38725)Nathan Sarang-Walters1-1/+4
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-04-11dropdown.spec.js: expect nothing in constructor (#38442)XhmikosR1-0/+1
2023-03-29Tweak and re-organize ESLint config (#38369)XhmikosR1-4/+4
* Tweak and re-organize ESLint config * merge individual configs to the root config * enable more eslint-plugin-import rules * lint markdown files * Lint
2022-09-27Dropdown: fix case with invalid markup (#37190)GeoSot1-0/+22
This fixes a backward incompatible change in v5.2.1 where `.drodown-toggle` isn't present in the markup.
2022-09-02fix(dropdowns): Fix multiple dropdowns when they are inside the same tag ↵Louis-Maxime Piton1-0/+61
(#37011)
2022-06-08Fix typo in dropdown unit testJulien Déramond1-1/+1
2022-05-31JS: tests fixes & standardization of spies usage (#36398)Louis-Maxime Piton1-18/+18
* Fix carousel spec typo * Change carousel test name in align with testing method * Make the spies declarations the same everywhere
2022-03-19No propagating escape event in an open dropdown.louismaxime.piton1-0/+35
2022-02-28add testsMark Otto1-0/+49
2022-02-19tests: revisit all tests using Promise.reject instead of throwing an error ↵GeoSot1-24/+24
(#35765)
2022-02-15Update devDependencies (#35841)XhmikosR1-1/+1
* Update devDependencies * @babel/core ^7.17.0 → ^7.17.2 * @rollup/plugin-replace ^3.0.1 → ^3.1.0 * eslint ^8.8.0 → ^8.9.0 * eslint-config-xo ^0.39.0 → ^0.40.0 * hugo-bin ^0.80.1 → ^0.80.2 * karma ^6.3.15 → ^6.3.16 * rollup ^2.67.1 → ^2.67.2 * Fix new ESLint errors
2022-02-09Remove remaining `.navbar-light` classes (#35814)Julien Déramond1-2/+2
* Fix typo in CSS variables documentation * Drop remaining .navbar-light classes
2022-02-01Dropdown: merge instance identification in `dataApiKeydownHandler`GeoSot1-0/+20
As we use the `dataApiKeydownHandler` only for events that are triggered on `[data-bs-toggle="dropdown"]` or on `.dropdown-menu`, we can ensure that their `parentNode` will ALWAYS be the `.dropdown` wrapper
2022-01-30tests: replace 'done' callback with 'Promise' to fix deprecation errors (#35659)GeoSot1-1370/+1486
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-09Fix tests fixture type (#35501)XhmikosR1-6/+6
Previously we were adding an Array instead of a String
2021-12-09Dropdown: fix toggle focus after dropdown is hidden using the `ESC` button ↵GeoSot1-0/+28
(#35500)
2021-12-02Tests: Minor fixes (#35455)Louis-Maxime Piton1-1/+1
2021-12-01Dropdown: Merge `display='static'` & `isNavbar` functionality activating ↵GeoSot1-5/+5
static popper with no styles attached
2021-12-01Dropdown tests: Use a function to improve readability (#35448)GeoSot1-32/+13
2021-12-01tests: remove extra spaces, unneeded arrays and add missing newlinesXhmikosR1-3/+3
2021-12-01tests: tweak Jasmine's matchers usageXhmikosR1-63/+63
Use: * toBeNull * toEqual * toBeTrue * toBeFalse * toHaveSize * toHaveClass
2021-10-08tests: minor cleanup (#35138)XhmikosR1-5/+3
* tests: minor cleanup * tests: use the util noop function
2021-09-15Rename `e` to `event` (#34979)XhmikosR1-14/+14
2021-07-22handle click event in one place, remove undocumented click listener on ↵GeoSot1-24/+2
element in case of not having the proper markup
2021-06-03Add `getOrCreateInstance` method in base-component (#33276)GeoSot1-0/+54
Co-authored-by: Rohit Sharma <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-05-22Automatically select an item in the dropdown when using arrow keys (#34052)alpadev1-8/+33
2021-05-13Move get element functionality to a helper (#33327)GeoSot1-1/+2
Looking around on js components I found out many checks, different expressed but with same purpose. Some of them are trying to parse string to element, others, jQuery element to js simple nodeElement etc With this Pr, I am trying to give a standard way to parse an element So this pr: * Creates `getElement` helper that tries to parse an argument to element or null * Changes `isElement` to make explicit checks and return Boolean * fixes tests deficiencies
2021-05-11Fix test warning for dropdown, without expectations (#33938)GeoSot1-0/+1
Co-authored-by: XhmikosR <[email protected]>
2021-05-11Fix: Click on input outside of dropdown-menu prevents dropdown from closing ↵alpadev1-2/+28
(#33920) * test: add test if user clicks on input not contained within dropdown-menu * fix: click on inputs that are not contained within dropdown-menu prevent dropdown from closing
2021-05-11Remove potential false positive assertions (#33288)Ben Lertlumprasertkul1-7/+7
* 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-25Add missing test for clicking select option in a dropdown (#33734)alpadev1-0/+41
2021-04-20Dropdown — Add option to make the dropdown menu clickable (#33389)Rohit Sharma1-4/+97
2021-04-11Update tests to check for `noop` to be removedRohit Sharma1-2/+3
2021-04-01Add missing things in `hide` method of dropdown (#33451)Rohit Sharma1-1/+35
* Update `aria-expanded` attribute in `hide` method * Remove empty mouseover listeners added for iOS
2021-04-01Fix dropdown escape propagation (#33479)alpadev1-0/+33
2021-03-23Allow data-toggle="dropdown" and form click events to bubbleCasey Holzer1-2/+49
* remove stopPropagation from button click event * test for delegated click events * ensure button children can open menu * test to ensure clicking button opens the menu * check current element and parents * allow dropdown form click events to bubble
2021-03-17Update unit tests for Popper V2 (#32662)Rohit Sharma1-1/+1
2021-02-22Allow constructors to accept a CSS selector (#32245)Rohit Sharma1-0/+18
Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2021-02-16Add tests for `DATA_KEY` (#33090)GeoSot1-0/+6
Co-authored-by: XhmikosR <[email protected]>
2021-02-12Fix event handler removal in dropdown/carousel dispose (#33000)Kyle Tsang1-0/+5
* Fix event handler removal in carousel dispose * Fix event handler removal in dropdown dispose * Test event handlers in scrollspy dispose * Test event handlers in toast dispose * Test event handlers in tooltip dispose Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Rohit Sharma <[email protected]>
2021-02-09Add function type for `popperConfig` option (#32882)Rohit Sharma1-0/+22
* Add function type for `popperConfig` option * Update .bundlewatch.config.json * copy edits Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2021-02-09Remove .dropdown-menu[style] reset and adjust .dropdown-menu-* modifiersMark Otto1-1/+59
- Removes the &[style] selector that was used for resetting Popper styles - Separate Popper-based alignment from static alignment with `data-bs-popover` attribute that separates the --bs-position and custom right/left properties Co-Authored-By: Rohit Sharma <[email protected]>
2021-02-03Fix dropdown keys to open menu (#32750)Siju Samson1-0/+48
Co-authored-by: XhmikosR <[email protected]>
2021-02-03Dropdown — Emit events on the `.dropdown-toggle` button (#32625)Rohit Sharma1-103/+99
* Emit events on the dropdown button Emit the events on `.dropdown-toggle` button and then bubble up * Add migration note for events * Update the docs for events * Add unit test to check the event bubbling Co-authored-by: XhmikosR <[email protected]>
2021-01-28Restore offset option for dropdown componentjoke2k1-0/+48
2021-01-13Throw a `TypeError` instead of the generic `Error` (#32585)Rohit Sharma1-6/+4
* 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-12-21Support Popper virtual elements (#32376)Nils K1-0/+52
Adds the ability to use objects implementing the virtual element interface as the value for the reference option of a dropdown config. Co-authored-by: XhmikosR <[email protected]>
2020-12-06Update to popper.js v2.xJohann-S1-93/+2
2020-12-04feat(RTL): implement RTLGaël Poupard1-10/+10
Using RTLCSS directives, renaming things to use logical names and following best practices.