aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/util/index.spec.js
AgeCommit message (Collapse)AuthorFilesLines
2021-09-11Extract Config functionalityGeoSot1-47/+0
2021-07-20Fix `Util.reflow` function and add documentation (#34543)GeoSot1-2/+3
* add documentation to reflow function * refactor to void as it should be Co-authored-by: XhmikosR <[email protected]>
2021-06-22Register only one `DOMContentLoaded` event listener in `onDOMContentLoaded` ↵alpadev1-2/+11
(#34158) * refactor: reuse one DOMContentLoaded event listener in onDOMContentLoaded function Instead of adding an event listener everytime the utility function is called, cache the callbacks and execute them all at once. * refactor: drop iife for onDOMContentLoaded Co-authored-by: XhmikosR <[email protected]>
2021-06-03Fix handling of transitionend events dispatched by nested elements(#33845)alpadev1-29/+124
Fix handling of transitionend events dispatched by nested elements Properly handle events from nested elements Change `emulateTransitionEnd` to `executeAfterTransition` &&
2021-05-22Automatically select an item in the dropdown when using arrow keys (#34052)alpadev1-1/+12
2021-05-20Refactor `isVisible` helper, fixing false positives from deep nesting or ↵Ryan Berliner1-2/+50
alternate means (#33960)
2021-05-19Add `getNextActiveElement` helper function to utils, replacing custom ↵GeoSot1-0/+39
implementation through components (#33608)
2021-05-13Move get element functionality to a helper (#33327)GeoSot1-9/+43
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-11Extract static `DATA_KEY` & `EVENT_KEY` to base-component (#33635)GeoSot1-1/+2
* Force each plugin that extends base-components to implement a static method `NAME()` * Remove redundant `NAME` argument from 'Utils.defineJQueryPlugin' & fix test
2021-04-14Decouple BackDrop from modal (#32439)GeoSot1-0/+8
* Create backdrop.js util * revert breaking changes remove PromiseTimout usage revert class name * one more test | change bundlewatch.config * add config obj to backdrop helper | tests for rootElement | use transitionend helper * Minor tweaks — Renaming Co-authored-by: Rohit Sharma <[email protected]>
2021-04-11Use cached `noop` function everywhereRohit Sharma1-2/+2
2021-03-17Use more safe check for 'isDisabled' helper (#33385)GeoSot1-1/+4
2021-03-16Accept data-bs-body option in the configuration object as well (#33248)GeoSot1-0/+105
* Accept data-bs-body option in the configuration object as well Tweak jqueryInterface, add some more tests * Fix Markdown table formatting and tweak the wording on backdrop Co-authored-by: Mark Otto <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-02-03Prevent `getSelector` from returning URLs as selector (#32586)Florian Vick1-0/+22
* added checks to getSelector in util to prevent returning hrefs that are invalid selectors * restored compatibility for the class selector and added test cases for keeping urls from being returned as a selector Co-authored-by: XhmikosR <[email protected]>
2021-01-13Throw a `TypeError` instead of the generic `Error` (#32585)Rohit Sharma1-1/+1
* 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-08Refactor components to use a utility function to define jQuery plugins (#32285)alpadev1-0/+25
* refactor: use an utility function to define jQuery plugins * test: add spec for defineJQueryPlugin utility function * Update .bundlewatch.config.json Co-authored-by: XhmikosR <[email protected]>
2020-11-14Add `bs` in data attributesRohit Sharma1-11/+11
- Add `bs` in data APIs everywhere - Update unit tests
2020-11-01Fix TypeError when Bootstrap is included in `head` (#32024)Sascha1-0/+19
* extend jquery after domContentLoaded event is fired * add unittest for util onDOMContentLoaded * wait for trigger jquery event after domContentLoaded * remove domcontentready from eventHandler * move istanbul ignore statements to correct line Co-authored-by: XhmikosR <[email protected]>
2020-03-25fix: remove make array util function (#30430)Johann-S1-14/+0
2020-03-18fix: ensure `totype` always returns stringified null/undefined when ↵Johann-S1-1/+30
null/undefined is passed (#30383)
2019-10-09Rename "js/tests/units" to "js/tests/unit". (#29503)XhmikosR1-0/+382