aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/offcanvas.spec.js
AgeCommit message (Collapse)AuthorFilesLines
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-5/+5
* Tweak and re-organize ESLint config * merge individual configs to the root config * enable more eslint-plugin-import rules * lint markdown files * Lint
2022-07-14Offcanvas: activate focustrap when backdrop is enabled (#36717)GeoSot1-1/+23
* fix(offcanvas): activate focustrap when backdrop is enabled * Adding tabindex='-1' for both offcanvases in the docs * Remove useless aria-expanded='false' in togglers * Update js/tests/unit/offcanvas.spec.js Co-authored-by: Julien Déramond <[email protected]> Co-authored-by: Julien Déramond <[email protected]> Co-authored-by: Patrick H. Lauke <[email protected]>
2022-07-04ref(tests): Minor fix to use self-closing input HTML tag (#36667)Julien Déramond1-1/+1
2022-05-31JS: tests fixes & standardization of spies usage (#36398)Louis-Maxime Piton1-68/+66
* Fix carousel spec typo * Change carousel test name in align with testing method * Make the spies declarations the same everywhere
2022-04-17v5.2.0 design refresh, plus responsive offcanvas classes (#35736)Mark Otto1-0/+22
* Add responsive offcanvas classes - Updates navbar-expand classes to de-dupe some styles—these shouldn't interfere now. - Adds some JS to the offcanvas component to help with responsiveness Co-Authored-By: GeoSot <[email protected]> * Redesign homepage, docs, and examples Homepage: - New Bootstrap purple navbar - Redesigned masthead - Rewrote and redesigned homepage content - Replace Copy text with icons like Bootstrap Icons site across all ClipboardJS instances - Fixed padding issues in site footer - Match homepage button styles to examples page, use gap instead of tons of responsive margin utils Docs: - New navbar, no more subnav. Migrated search and version picker into the main navbar and refreshed the design of it all, including the responsive toggles. - New sidebar navigation is always expanded, and now features Bootstrap Icons alongside section headings - Sidebar navigation autoscrolls to active link for better usability - Subnav and navbar padding issues ironed out - Enhanced the version picker in anticipation of v5.2: we can now link right to the same page in the previous version. - Redesign callouts to add more color to our pages - Collapse table of contents on mobile - Cleanup and redesign button styles with CSS variables - Update design for subnav version dropdown - Update highlight and example to be full-width until md - Improve the Added In badges - Turn the ToC into a well on mobile - Redesign code snippets to better house two action buttons Examples: - Redesign Examples page layout - Add new example for responsive offcanvases in navbars * Convert offcanvas to CSS vars * Feat: add resize handler to Offcanvas.js. If we could use as default the `.offcanvas` class without modifiers, we then, could add a simplified selector The selector itself, ignores the .offcanvas class as it doesn't have any responsive behavior The `aria-modal` addon is to protect us, selection backdrop elements * Separate examples code, Add some selectors, fix stackblitz btn Co-authored-by: GeoSot <[email protected]>
2022-03-02Add static backdrop to offcanvas (#35832)Jann Westermann1-10/+61
* Add static backdrop option, to offcanvas * Trigger prevented event on esc with keyboard=false * Change offcanvas doc , moving backdrop examples to examples section
2022-02-19tests: revisit all tests using Promise.reject instead of throwing an error ↵GeoSot1-4/+4
(#35765)
2022-01-30tests: replace 'done' callback with 'Promise' to fix deprecation errors (#35659)GeoSot1-275/+311
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-30Event handler: replace deprecated `initEvent`GeoSot1-2/+1
2022-01-05Remove explicit use of aria-hidden for offcanvas when closed (#35589)Patrick H. Lauke1-6/+53
Remove explicit use of aria-hidden & visibility for offcanvas when closed, handling it with css Co-authored-by: GeoSot <[email protected]> Co-authored-by: Gaël Poupard <[email protected]>
2021-12-02Tests: Minor fixes (#35455)Louis-Maxime Piton1-3/+3
2021-12-01tests: remove extra spaces, unneeded arrays and add missing newlinesXhmikosR1-12/+4
2021-12-01tests: tweak Jasmine's matchers usageXhmikosR1-27/+27
Use: * toBeNull * toEqual * toBeTrue * toBeFalse * toHaveSize * toHaveClass
2021-10-08tests: minor cleanup (#35138)XhmikosR1-3/+1
* tests: minor cleanup * tests: use the util noop function
2021-09-15Rename `e` to `event` (#34979)XhmikosR1-4/+4
2021-07-27Add shift-tab keyboard support for dialogs (modal & Offcanvas components) ↵Ryan Berliner1-6/+26
(#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-06-06Refactor scrollbar.js to be used as a Class (#33947)GeoSot1-9/+10
2021-06-03Add `getOrCreateInstance` method in base-component (#33276)GeoSot1-34/+54
Co-authored-by: Rohit Sharma <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-05-11Fix offcanvas test to expect the initial body `overflow` value (#33927)GeoSot1-1/+2
Co-authored-by: XhmikosR <[email protected]>
2021-05-11Remove potential false positive assertions (#33288)Ben Lertlumprasertkul1-3/+3
* 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-7/+3
* add method to handle overflow on body element & tests * replace duplicated code on modal/offcanvas tests
2021-04-20Offcanvas.js: If scroll is allowed, should allow focus on other elements ↵GeoSot1-0/+34
(#33677)
2021-04-19Use the backdrop util in offcanvas, enforcing consistency (#33545)GeoSot1-7/+93
* respect /share modal's backdrop functionality, keeping consistency * listen click events over backdrop (only) and trigger `hide()` without add/remove event tricks * achieve to hide foreign open offcanvas instances without glitches `if (allReadyOpen && allReadyOpen !== target)`, in case another is going to be open, when user clicks on trigger button
2021-04-14Js: fix some testsGeoSot1-1/+10
2021-03-23Allow offcanvas to be initialized in open state (#33382)GeoSot1-7/+131
* Update docs to use new .show behavior and clarify some copy for first example Co-authored-by: Mark Otto <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-03-16Accept data-bs-body option in the configuration object as well (#33248)GeoSot1-1/+133
* 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-16Change the name of the `Offcanvas` constructor (#33261)Rohit Sharma1-29/+29
2021-03-02Offcanvas as component (#29017)GeoSot1-0/+324
* 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]>