Louis-Maxime Piton
d388bd6e1b
JS: tests fixes & standardization of spies usage ( #36398 )
...
* Fix carousel spec typo
* Change carousel test name in align with testing method
* Make the spies declarations the same everywhere
2022-05-31 11:18:32 +03:00
GeoSot
554736834d
Carousel: Fix not used option (ride
), simplify cycle
method ( #35983 )
...
* Fix not used option (`ride`) (according to docs), continuing of #35753 a247fe9
* separate concept of `programmatical cycle` vs `maybe cycle after click` functionality
2022-04-21 22:42:17 +03:00
GeoSot
6e904341c9
Carousel: change class check as it can only exist if carousel is sliding
...
Also, fix the corresponding test
2022-03-10 15:22:14 +02:00
GeoSot
3673933fe7
Carousel: rename private property
2022-03-10 15:22:14 +02:00
GeoSot
88da704eed
Carousel: omit redundant checks as we are always transforming the right values
2022-03-10 15:22:14 +02:00
GeoSot
699402bee5
Carousel: refactor _slide
method te accept only order as first argument
2022-03-09 17:25:47 +02:00
GeoSot
a8142497c7
Carousel: reorder variables and refactor method to use it inline
2022-03-09 17:25:47 +02:00
GeoSot
4b17868fb4
tests: revisit all tests using Promise.reject instead of throwing an error ( #35765 )
2022-02-19 16:08:16 +02:00
GeoSot
aa650f0f1e
tests: replace 'done' callback with 'Promise' to fix deprecation errors ( #35659 )
...
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-30 14:30:04 +02:00
GeoSot
0d4213bde3
Carousel: move repeated code to a method
2021-12-21 17:37:24 +02:00
Louis-Maxime Piton
d8999dd566
Tests: Minor fixes ( #35455 )
2021-12-02 12:01:11 +02:00
XhmikosR
f8f9dc3b5c
tests: remove extra spaces, unneeded arrays and add missing newlines
2021-12-01 14:30:49 +02:00
XhmikosR
eb54e1a1ce
tests: tweak Jasmine's matchers usage
...
Use:
* toBeNull
* toEqual
* toBeTrue
* toBeFalse
* toHaveSize
* toHaveClass
2021-12-01 14:30:49 +02:00
GeoSot
b991a6b851
tests: try to fix a few random failures ( #35184 )
...
* Change `Swipe` dispose spy on EventHandler
* Modal hide spy on backdrop hide
2021-10-13 17:45:39 +03:00
GeoSot
8ec6c94522
Extract Carousel's swipe functionality to a separate Class ( #32999 )
2021-10-11 17:04:43 +03:00
XhmikosR
a260967a55
tests: minor cleanup ( #35138 )
...
* tests: minor cleanup
* tests: use the util noop function
2021-10-08 12:32:11 +03:00
XhmikosR
666fe596bf
Enable unicorn/no-array-for-each
rule
2021-10-05 19:52:11 +03:00
XhmikosR
c5d03d93fc
Rename e
to event
( #34979 )
2021-09-15 14:27:46 +03:00
XhmikosR
6d707f4801
Enable a few eslint-config-xo rules ( #34620 )
...
* unicorn/prefer-dom-node-append
* unicorn/prefer-dom-node-remove
2021-07-30 00:23:00 +02:00
alpadev
290b9ee2cd
fix(carousel): arrow keys break animation if carousel sliding ( #34307 )
2021-06-22 13:11:03 +03:00
alpadev
d62ba935ef
Fix carousel buttons ( #34266 )
...
* test(carousel): add test to check if next/prev button work as intended
* fix(carousel): merge passed config with instance config in carouselInterface
2021-06-16 07:48:23 +03:00
GeoSot
c98657b830
Add getOrCreateInstance
method in base-component ( #33276 )
...
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-06-03 18:53:27 +03:00
Ben Lertlumprasertkul
052def4568
Remove potential false positive assertions ( #33288 )
...
* 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 <xhmikosr@gmail.com>
2021-05-11 08:45:57 +03:00
GeoSot
0795a778f2
Fix wrong carousel transformation, direction to order ( #33499 )
2021-04-07 08:29:31 +03:00
GeoSot
b9f30903a5
Fix carousel RTL and refactor code, fix rtl swipe issues ( #32913 )
...
* move common code to reusable functions
* add/re-factor tests, directionToOrder func
* add _orderToDirection tests
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-17 07:58:43 +02:00
Rohit Sharma
dc5e3328c1
Allow constructors to accept a CSS selector ( #32245 )
...
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <otto@github.com>
2021-02-22 09:01:04 +02:00
GeoSot
3602828a90
Add tests for DATA_KEY
( #33090 )
...
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-16 08:58:08 +02:00
Rohit Sharma
6b6db4fd8a
Add the missing expectations for touch events ( #33060 )
2021-02-12 08:36:20 +02:00
Kyle Tsang
02dbd87ffa
Fix event handler removal in dropdown/carousel dispose ( #33000 )
...
* Fix event handler removal in carousel dispose
* Fix event handler removal in dropdown dispose
* Test event handlers in scrollspy dispose
* Test event handlers in toast dispose
* Test event handlers in tooltip dispose
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
2021-02-12 07:51:34 +02:00
Patrick H. Lauke
a882614c45
Make carousel indicators actual buttons
2021-01-28 23:32:24 +02:00
Patrick H. Lauke
3aa3fda730
Carousel: use buttons, not links, for prev/next controls ( #32627 )
...
* Carousel: use buttons, not links, for prev/next
- expand the styles to neutralise border/background
- change docs page
- add extra unit test to check that links or buttons work as controls
- modify visual test to use buttons as well
- use buttons instead of links for prev/next
- remove `role="button"` from links that are actually links
* Clarify that controls can be button or link
* Update site/content/docs/5.0/components/carousel.md
Co-authored-by: Mark Otto <markd.otto@gmail.com>
* Explicitly set padding to 0 to prevent dipping/moving on active in Firefox
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-27 17:31:16 +02:00
Rohit Sharma
c9cd741aff
Throw a TypeError
instead of the generic Error
( #32585 )
...
* 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 <xhmikosr@gmail.com>
2021-01-13 22:13:30 +02:00
Gaël Poupard
58ab1c2cd5
test(carousel): french word in the wild ( #32528 )
2020-12-18 17:22:16 +02:00
XhmikosR
51a208f119
Switch to Jasmine's toBeInstanceOf
matcher
2020-11-29 20:58:26 +02:00
Johann-S
9f6b342dc7
create a base component
2020-11-29 20:58:26 +02:00
Rohit Sharma
418f17ee2b
Add bs
in data attributes
...
- Add `bs` in data APIs everywhere
- Update unit tests
2020-11-14 07:09:15 +02:00
Mitchell Bryson
3a5f9f5cf0
Check for data-interval on the first slide of carousel ( #31818 )
...
* check for data-interval on the first slide of carousel
* add updateInterval method for elements of a carousel
* add test for carousel interval being set during cycle
* update activeElement as soon as slide has finished (before transition end)
* only updateInterval before using it
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-11-01 14:36:50 +02:00
XhmikosR
967e6071ba
tests: streamline HTML end tags ( #30648 )
2020-05-06 09:20:08 +03:00
Tanguy Krotoff
dcd99aa7d1
Replace event.which with event.key and event.button
2020-04-17 18:22:15 +03:00
XhmikosR
e1f5d819c7
Remove MSPointerEvent
and ms-touch-action
in tests ( #30463 )
2020-03-29 09:59:54 +03:00
XhmikosR
577bf8b14d
Rename "js/tests/units" to "js/tests/unit". ( #29503 )
2019-10-09 01:27:43 +03:00