Skip to content

Commit

Permalink
Fixes tests with new cases | Fixes liferay#910
Browse files Browse the repository at this point in the history
  • Loading branch information
matuzalemsteles committed May 22, 2018
1 parent d03e338 commit 04e56ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/clay-alert/src/__tests__/ClayStripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('ClayStripe', function() {
});

// eslint-disable-next-line
it('should close automatically an stripe after 5 seconds when message has no links', function() {
it('should close automatically an stripe after 5 seconds', function() {
jest.useFakeTimers();

stripe = new ClayStripe({
Expand All @@ -131,11 +131,11 @@ describe('ClayStripe', function() {
});

// eslint-disable-next-line
it('should close automatically an stripe after 5 seconds when message has links', function() {
it('should close automatically an stripe after 10 seconds', function() {
jest.useFakeTimers();

stripe = new ClayStripe({
autoClose: true,
autoClose: 10,
message: 'message<a href="#">Link</a>',
spritemap: spritemap,
title: 'Success!',
Expand Down
8 changes: 4 additions & 4 deletions packages/clay-alert/src/__tests__/ClayToast.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('ClayToast', function() {
});

// eslint-disable-next-line
it('should close automatically a toast after 8 seconds when message has no links', function() {
it('should close automatically a toast after 8 seconds', function() {
jest.useFakeTimers();

toast = new ClayToast({
Expand All @@ -131,18 +131,18 @@ describe('ClayToast', function() {
});

// eslint-disable-next-line
it('should close automatically a toast after 8 seconds when message has links', function() {
it('should close automatically a toast after 12 seconds', function() {
jest.useFakeTimers();

toast = new ClayToast({
autoClose: true,
autoClose: 12,
message: 'message<a href="#">Link</a>',
spritemap: spritemap,
title: 'Success!',
});

expect(setTimeout.mock.calls.length).toBe(1);
expect(setTimeout.mock.calls[0][1]).toBe(8000);
expect(setTimeout.mock.calls[0][1]).toBe(12000);

jest.runAllTimers();
expect(toast._visible).toBeFalsy();
Expand Down

0 comments on commit 04e56ef

Please sign in to comment.