aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/util
AgeCommit message (Collapse)AuthorFilesLines
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-03-02Offcanvas as component (#29017)GeoSot1-0/+182
* Add a new offcanvas component * offcanvas.js: switch to string constants and `event.key` * Remove unneeded code * Sass optimizations * Fixes Make sure the element is hidden and not offscreen when inactive fix close icon negative margins Add content in right & bottom examples Re-fix bottom offcanvas height not to cover all viewport * Wording tweaks * update tests and offcanvas class * separate scrollbar functionality and use it in offcanvas * Update .bundlewatch.config.json * fix focus * update btn-close / fix focus on close * add aria-modal and role return focus on trigger when offcanvas is closed change body scrolling timings * move common code to reusable functions * add aria-labelledby * Replace lorem ipsum text * fix focus when offcanvas is closed * updates * revert modal, add tests for scrollbar * show backdrop by default * Update offcanvas.md * Update offcanvas CSS to better match modals - Add background-clip for borders - Move from outline to border (less clever, more consistent) - Add scss-docs in vars * Revamp offcanvas docs - Add static example to show and explain the components - Split live examples and rename them - Simplify example content - Expand docs notes elsewhere - Add sass docs * Add .offcanvas-title instead of .modal-title * Rename offcanvas example to offcanvas-navbar to reflect it's purpose * labelledby references title and not header * Add default shadow to offcanvas * enable offcanvas-body to fill all the remaining wrapper area * Be more descriptive, on Accessibility area * remove redundant classes * ensure in case of an already open offcanvas, not to open another one * bring back backdrop|scroll combinations * bring back toggling class * refactor scrollbar method, plus tests * add check if element is not full-width, according to #30621 * revert all in modal * use documentElement innerWidth * Rename classes to -start and -end Also copyedit some docs wording * omit some things on scrollbar * PASS BrowserStack tests -- IOS devices, Android devices and Browsers on Mac, hide scrollbar by default and appear it, only while scrolling. * Rename '_handleClosing' to '_addEventListeners' * change pipe usage to comma * change Data.getData to Data.get Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Martijn Cuppens <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2021-02-19Adjust regex `SAFE_URL_PATTERN` for use with test method of regexes. (#33136)Nikon the Third1-0/+10
The test method on regexes behaves different than the match method on strings in the presence of the global modifier. Add a unit test for sanitizing the same template twice. 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-02tests: fix sanitizer test. (#32045)XhmikosR1-1/+1
The test template does not include a `script` tag so the test always returned true.
2020-11-02tests: switch to using `toContain()` to check for substring presence (#32043)XhmikosR1-4/+4
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-06-19Change whitelist to allowlist (#31066)Patrick H. Lauke1-7/+7
Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Mark Otto <[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)XhmikosR2-0/+452
2019-07-23Switch from QUnit to Jasmine.Johann-S2-242/+0
2019-03-11Comply to the new rules.XhmikosR1-5/+5
2019-02-26move util in a util folder with the sanitizerJohann-S2-0/+242