aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/dom
AgeCommit message (Collapse)AuthorFilesLines
2024-02-18Selector Engine: fix multiple IDs (#39201)GeoSot1-0/+12
* fix: regression of #38989 * Add unit test in selector-engine.spec.js --------- Co-authored-by: Julien Déramond <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2023-09-13Fix collapse multiple ids target (#38989)Louis-Maxime Piton1-0/+12
2023-03-29Tweak and re-organize ESLint config (#38369)XhmikosR4-11/+9
* Tweak and re-organize ESLint config * merge individual configs to the root config * enable more eslint-plugin-import rules * lint markdown files * Lint
2022-11-06Move `getElementFromSelector` & `getSelectorFromElement` to SelectorEngine ↵GeoSot1-2/+156
(#36027) * Move `getElementFromSelector` & getSelectorFromElement` inside selector-engine.js, in order to use SelectorEngine methods, avoiding raw querySelector usage * add `getMultipleElementsFromSelector` helper Co-authored-by: Julien Déramond <[email protected]>
2022-07-19Fix failing test on EventHandler (#36772)GeoSot1-4/+3
2022-07-18Fix typos in code (#36763)Marc Wrobel1-1/+1
Shoutout is correct but has been replaced by its more common form : Shout-out (https://www.merriam-webster.com/dictionary/shout-out).
2022-07-04ref(tests): Minor fix to use self-closing input HTML tag (#36667)Julien Déramond1-1/+1
2022-06-30Fix interoperability issue regarding Event properties (#36386)Aleksander Machniak1-0/+37
* Fix interoperability issue regarding Event properties - make possible to re-set read-only event properties - use hydrateObj() to set delegateTarget property Fixes #36207 Co-authored-by: GeoSot <[email protected]> Co-authored-by: Julien Déramond <[email protected]>
2022-04-21Manipulator: Add JSON parse support (#35077)GeoSot1-0/+27
Support parsing JSON from each component's main element using the `data-bs-config` attribute. The `bs-config` attribute will be reserved and omitted during `getDataAttributes` parsing. With this commit, every component, will create its config object, using: * defaults * data-bs-config * the rest of data attributes * configuration object given during instance initialization Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Mark Otto <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2022-04-13Revamp Scrollspy using Intersection observer (#33421)GeoSot1-82/+0
* Revamp scrollspy to use IntersectionObserver * Add smooth scroll support * Update scrollspy.js/md * move functionality to method * Update scrollspy.js * Add SmoothScroll to docs example * Refactor Using `Maps` and smaller methods * Update scrollspy.md/js * Update scrollspy.spec.js * Support backwards compatibility * minor optimizations * Merge activation functionality * Update scrollspy.md * Update scrollspy.js * Rewording some of the documentation changes * Update scrollspy.js * Update scrollspy.md * tweaking calculation functionality & drop text that suggests, to deactivate target when wrapper is not visible * tweak calculation * Fix lint * Support scrollspy in body & tests * change doc example to a more valid solution Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Patrick H. Lauke <[email protected]>
2022-02-19tests: revisit all tests using Promise.reject instead of throwing an error ↵GeoSot1-2/+2
(#35765)
2022-01-30tests: replace 'done' callback with 'Promise' to fix deprecation errors (#35659)GeoSot2-285/+316
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)XhmikosR2-13/+17
Previously we were adding an Array instead of a String
2021-12-01tests: fix a few typosXhmikosR1-1/+1
2021-12-01tests: remove extra spaces, unneeded arrays and add missing newlinesXhmikosR1-12/+4
2021-12-01tests: tweak Jasmine's matchers usageXhmikosR4-16/+17
Use: * toBeNull * toEqual * toBeTrue * toBeFalse * toHaveSize * toHaveClass
2021-10-08tests: minor cleanup (#35138)XhmikosR4-9/+2
* tests: minor cleanup * tests: use the util noop function
2021-07-30Enable a few eslint-config-xo rules (#34620)XhmikosR2-5/+5
* unicorn/prefer-dom-node-append * unicorn/prefer-dom-node-remove
2021-07-28Fix `Manipulator.offset()` (#33603)alpadev1-0/+54
* test: add more test cases for Manipulator.offset() * fix: Manipulator.offset() is using obsolete properties to get scroll position Co-authored-by: XhmikosR <[email protected]> Co-authored-by: GeoSot <[email protected]>
2021-07-27Add shift-tab keyboard support for dialogs (modal & Offcanvas components) ↵Ryan Berliner1-0/+82
(#33865) * consolidate dialog focus trap logic * add shift-tab support to focustrap * remove redundant null check of trap element Co-authored-by: GeoSot <[email protected]> * remove area support forom focusableChildren * fix no expectations warning in focustrap tests Co-authored-by: GeoSot <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-04-19Fix regression for handling `mouseenter`/`mouseleave` events introduced by ↵alpadev1-1/+15
#33310 (#33679) * test: update spec for sibling adjacent mouseenter/mouseleave events there is a regression introduced by #33310 - this would have catched that * fix: fixup regression for mouseenter/mouseleave events introduced by #33310 the old logic only worked for parent-child movement since it checked for the relatedTarget to contain the delegateTarget - this should be fixed with this Co-authored-by: XhmikosR <[email protected]>
2021-04-13fix: make EventHandler better handle mouseenter/mouseleave events (#33310)alpadev1-1/+77
* fix: make EventHandler better handle mouseenter/mouseleave events * refactor: simplify custom events regex and move it to a variable
2021-03-02refactor: use a Map instead of an Object in dom/data (#32180)alpadev1-88/+63
Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Rohit Sharma <[email protected]>
2020-12-07Remove `SelectorEngine.matches()`. (#32339)XhmikosR1-8/+0
It's basically unused.
2020-11-20Make the attribute methods bs specific (#32173)Rohit Sharma1-18/+22
Co-authored-by: XhmikosR <[email protected]>
2020-11-14Get only bs prefixed data attributesRohit Sharma1-18/+2
2020-11-14Add `bs` in data attributesRohit Sharma1-4/+20
- Add `bs` in data APIs everywhere - Update unit tests
2020-11-02tests: tweak Jasmine usage (#32046)XhmikosR2-6/+6
* jasmine/expect-matcher * jasmine/prefer-jasmine-matcher Found with `eslint-plugin-jasmine`
2020-10-05Remove `Manipulator.toggleClass` (#31842)XhmikosR1-26/+0
It's only used in one place so it makes more sense to remove it for the time being.
2020-06-17data: reword storage key in domJohann-S1-7/+7
2020-03-25fix: remove make array util function (#30430)Johann-S1-6/+5
2020-03-23Use next dropdown menu instead of first of the parentMartijn Cuppens1-0/+39
2020-03-09`prev()` function fails when non-element nodes are present (#30117)Martijn Cuppens1-0/+15
The `prev()` function doesn't take nodes other than elements into account. Also we could simplify things a lot using the `previousElementSibling` property. This property isn't fully supported in IE, it only works for elements, but since the `element` variable is an element, we can safely use it here. I've also added an additional test. I don't think we had this issue in v4, since we relied on jQuery back then. Ref. https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode/nextElementSibling
2019-10-31Update normalizeDataKey to match the spec (#29609)Steffen Roßkamp1-10/+10
2019-10-09Rename "js/tests/units" to "js/tests/unit". (#29503)XhmikosR4-0/+731
2019-07-23rewrite unit tests for selector engineJohann-S1-77/+0
2019-07-23rewrite manipulator unit testsAnton Bershanskiy1-128/+0
2019-07-23Switch from QUnit to Jasmine.Johann-S2-423/+0
2019-07-17updated babelJohann-S1-10/+0
2019-05-08Rename `eventHandler` and `selectorEngine` files.XhmikosR2-0/+0
2019-02-20Improve manipulator coverageJohann-S1-1/+6
2019-02-20Remove IE support and button bsChecked hackAlessandro Chitolina1-46/+0
2019-02-20fix(selector-engine): increase coverage for selector engineJohann-S2-1/+78
2019-02-20fix(manipulator): increase coverage for manipulatorJohann-S1-0/+179
2019-02-20fix(data): increase coverage for dataJohann-S1-0/+83
2019-02-20Dropdown without jQueryJohann-S1-1/+0
2019-02-20allow register the same handler for different delegated selectors in ↵Alessandro Chitolina1-0/+70
eventHandler
2019-02-20tooltip without jqueryAlessandro Chitolina1-0/+14
2019-02-20Workaround for M$ Edge resetting defaultPrevented flag upon dispatchEventAlessandro Chitolina1-0/+18
2019-02-20Rewritten modal without jquery (#23955)Alessandro Chitolina1-0/+239
* Trigger jquery events if available in event handler * Rewritten modal without jquery