Skip to content

Commit e18adf5

Browse files
committed
Use toContain for background gradient tests
1 parent 6074916 commit e18adf5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/slider/slider.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,13 @@ describe('MdSlider', () => {
446446
// both sides. The value 30 will be located at the position 33.6px, and 1px is removed from
447447
// the tick mark location in order to center the tick. Therefore, the tick separation should
448448
// be 32.6px.
449-
expect(tickContainer.style.background).toBe('repeating-linear-gradient(to right, ' +
449+
expect(tickContainer.style.background).toContain('repeating-linear-gradient(to right, ' +
450450
'rgb(0, 0, 0), rgb(0, 0, 0) 2px, transparent 2px, transparent 32.6px)');
451451
});
452452

453453
it('should draw a tick mark on the end of the track', () => {
454-
expect(lastTickContainer.style.background).toBe('linear-gradient(to left, rgb(0, 0, 0), ' +
455-
'rgb(0, 0, 0) 2px, transparent 2px, transparent)');
454+
expect(lastTickContainer.style.background).toContain('linear-gradient(to left, rgb(0, 0, 0), '
455+
+ 'rgb(0, 0, 0) 2px, transparent 2px, transparent)');
456456
});
457457

458458
it('should not draw the second to last tick when it is too close to the last tick', () => {
@@ -488,13 +488,13 @@ describe('MdSlider', () => {
488488
// The slider width is 112px, the first step is at value 18 (step of 3 * tick interval of 6),
489489
// which is at the position 20.16px and 1px is subtracted to center, giving a tick
490490
// separation of 19.16px.
491-
expect(tickContainer.style.background).toBe('repeating-linear-gradient(to right, ' +
491+
expect(tickContainer.style.background).toContain('repeating-linear-gradient(to right, ' +
492492
'rgb(0, 0, 0), rgb(0, 0, 0) 2px, transparent 2px, transparent 19.16px)');
493493
});
494494

495495
it('should draw a tick mark on the end of the track', () => {
496-
expect(lastTickContainer.style.background).toBe('linear-gradient(to left, rgb(0, 0, 0), ' +
497-
'rgb(0, 0, 0) 2px, transparent 2px, transparent)');
496+
expect(lastTickContainer.style.background).toContain('linear-gradient(to left, rgb(0, 0, 0), '
497+
+ 'rgb(0, 0, 0) 2px, transparent 2px, transparent)');
498498
});
499499
});
500500
});

0 commit comments

Comments
 (0)