aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/modal.spec.js
AgeCommit message (Collapse)AuthorFilesLines
2024-02-18Selector Engine: fix multiple IDs (#39201)GeoSot1-0/+29
* 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]>
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-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-15Fix modal event listeners (#37128)Jérémie Broutier1-0/+30
* Fix modal event listeners (#37126) Co-authored-by: GeoSot <[email protected]>
2022-09-07Fix modal event-listeners during dismiss click (#36863)GeoSot1-0/+4
ref: #36855
2022-07-15Standardization of `spyOn` usage (#36742)Julien Déramond1-3/+3
2022-06-21fix: change dismiss handler, listening to key down, instead of click (#36401)GeoSot1-6/+13
2022-05-31JS: tests fixes & standardization of spies usage (#36398)Louis-Maxime Piton1-48/+48
* Fix carousel spec typo * Change carousel test name in align with testing method * Make the spies declarations the same everywhere
2022-05-12Revert backdrop utilization, handling clicks over modal (#36324)GeoSot1-7/+3
* refactor(Modal.js): stop using backdrop class to handle clicks over modal * Revert #35554 and backdrop callback usage Explanation: In order to bypass `.modal`, was applied a css rule `pointer-events:none` which caused the side effect, and user couldn't scroll "long content modals" * Update .bundlewatch.config.json Co-authored-by: Mark Otto <[email protected]>
2022-03-01Modal: refactor listeners to reduce some code noise (#35902)GeoSot1-2/+2
2022-02-19tests: revisit all tests using Promise.reject instead of throwing an error ↵GeoSot1-12/+12
(#35765)
2022-01-30Modal.js: remove unnecessary checks from testGeoSot1-4/+0
2022-01-30Modal: handle click event from backdrop callbackGeoSot1-4/+7
2022-01-30tests: replace 'done' callback with 'Promise' to fix deprecation errors (#35659)GeoSot1-648/+714
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-02Tests: Minor fixes (#35455)Louis-Maxime Piton1-4/+2
2021-12-01tests: remove extra spaces, unneeded arrays and add missing newlinesXhmikosR1-3/+1
2021-12-01tests: tweak Jasmine's matchers usageXhmikosR1-13/+13
Use: * toBeNull * toEqual * toBeTrue * toBeFalse * toHaveSize * toHaveClass
2021-11-25Add test for modal-contentGeoSot1-0/+32
2021-10-13tests: try to fix a few random failures (#35184)GeoSot1-1/+2
* Change `Swipe` dispose spy on EventHandler * Modal hide spy on backdrop hide
2021-10-08tests: minor cleanup (#35138)XhmikosR1-2/+0
* tests: minor cleanup * tests: use the util noop function
2021-10-05Enable `unicorn/no-array-for-each` ruleXhmikosR1-4/+3
2021-09-15Rename `e` to `event` (#34979)XhmikosR1-14/+14
2021-08-10Fix modal when is triggered by `bs-toggle`, to hide other open instances ↵GeoSot1-0/+23
(#34701)
2021-07-30Enable a few eslint-config-xo rules (#34620)XhmikosR1-2/+2
* unicorn/prefer-dom-node-append * unicorn/prefer-dom-node-remove
2021-07-27Add shift-tab keyboard support for dialogs (modal & Offcanvas components) ↵Ryan Berliner1-24/+30
(#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-07-19modal: change `data-dismiss` so that it can be outside of a modal using ↵GeoSot1-1/+28
`bs-target` (#33403) * change data-dismiss, so can be outside modal, using a bs-target * Update site/content/docs/5.0/components/modal.md Co-authored-by: Gaël Poupard <[email protected]>
2021-06-06Refactor scrollbar.js to be used as a Class (#33947)GeoSot1-10/+9
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-06-03Fix handling of transitionend events dispatched by nested elements(#33845)alpadev1-0/+23
Fix handling of transitionend events dispatched by nested elements Properly handle events from nested elements Change `emulateTransitionEnd` to `executeAfterTransition` &&
2021-05-24Fix prevented show event disables modals with fade class from being ↵alpadev1-1/+30
displayed again (#34085) Fix modal, in case is faded, a prevented show event can cause show method to not be executed again.
2021-05-20Add Tests on scrollbar.js & better handling if a style property doesn't ↵GeoSot1-208/+4
exists (#33948) * scrollbar.js: add some tests transfer test from modal.spec. to scrollbar.spec proper handling if style property doesn't exist
2021-05-18Reset inside a Dialog does not work if `data-dismiss="modal"` is set (#33928)GeoSot1-0/+54
2021-05-11Remove potential false positive assertions (#33288)Ben Lertlumprasertkul1-19/+19
* 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-25Scrollbar: respect the initial body overflow value (#33706)GeoSot1-8/+3
* add method to handle overflow on body element & tests * replace duplicated code on modal/offcanvas tests
2021-04-18modal.js: fix test for scrollbar (#33666)GeoSot1-4/+6
Co-authored-by: XhmikosR <[email protected]>
2021-04-14Js: fix some testsGeoSot1-10/+9
2021-04-11Decouple Modal's scrollbar functionality (#33245)GeoSot1-39/+13
2021-04-08Remove unnecessary `data-bs-backdrop="static"` (#33578)Rohit Sharma1-3/+3
Since the value for the `backdrop` option is available in the configuration object.
2021-04-06Simplify Modal configGeoSot1-1/+18
2021-02-23modal: don't add margin & padding when sticky is not full width (#30621)Muhammadamin1-0/+24
* modal: don't add margin & padding when sticky is not full width * Check if element is shorter than window Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Rohit Sharma <[email protected]>
2021-02-22Allow constructors to accept a CSS selector (#32245)Rohit Sharma1-0/+13
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-01-13Throw a `TypeError` instead of the generic `Error` (#32585)Rohit Sharma1-4/+2
* 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]>
2021-01-13Fix toggling modal when clicking on `data-bs-toggle="modal"` (#32691)Rohit Sharma1-1/+10
Co-authored-by: XhmikosR <[email protected]>
2020-11-29Switch to Jasmine's `toBeInstanceOf` matcherXhmikosR1-1/+1
2020-11-29create a base componentJohann-S1-0/+1
2020-11-20Add missing tags in unit tests (#32221)Rohit Sharma1-15/+15
2020-11-20Don't hide modal when keyboard is set to false in modal's configuration (#32179)Rohit Sharma1-3/+2
* Don't hide modal when config.keyboard is false * Update unit test - Modal should not be closed when pressing esc key if keyboard = false and backdrop is 'static' Co-authored-by: XhmikosR <[email protected]>
2020-11-14Switch to Number propertiesXhmikosR1-6/+6
2020-11-14Add `bs` in data attributesRohit Sharma1-27/+27
- Add `bs` in data APIs everywhere - Update unit tests