aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/util/index.spec.js
AgeCommit message (Collapse)AuthorFilesLines
2024-07-19Fix `this` reference for JavaScript functions (#38725)Nathan Sarang-Walters1-2/+2
2023-03-29Tweak and re-organize ESLint config (#38369)XhmikosR1-3/+3
* 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-113/+0
(#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-10-07Boost `execute` function, being able to handle arguments (#36652)GeoSot1-0/+19
2022-07-04ref(tests): Minor fix to use self-closing input HTML tag (#36667)Julien Déramond1-3/+3
2022-05-31JS: tests fixes & standardization of spies usage (#36398)Louis-Maxime Piton1-2/+2
* Fix carousel spec typo * Change carousel test name in align with testing method * Make the spies declarations the same everywhere
2022-01-30tests: replace 'done' callback with 'Promise' to fix deprecation errors (#35659)GeoSot1-77/+88
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.
2022-01-13Fix: `isVisible` function behavior in case of a `<details>` element, on ↵Ryan Berliner1-0/+36
chrome 97 (#35682)
2021-12-10Extract Component config functionality to a separate class (#33872)GeoSot1-47/+0
Co-authored-by: XhmikosR <[email protected]>
2021-12-09Fix tests fixture type (#35501)XhmikosR1-10/+8
Previously we were adding an Array instead of a String
2021-12-01tests: remove extra spaces, unneeded arrays and add missing newlinesXhmikosR1-0/+1
2021-12-01tests: tweak Jasmine's matchers usageXhmikosR1-43/+43
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-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