Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: reorganize and cleanup date-picker tests #4791

Merged
merged 1 commit into from
Oct 21, 2022

Conversation

web-padawan
Copy link
Member

@web-padawan web-padawan commented Oct 20, 2022

Description

Reorganized vaadin-date-picker unit tests for better readability:

  1. Moved fullscreen tests to separate suite and changed to use setViewport command,
  2. Updated tests for ignoring overlay taps to use fake timers instead of long setTimeout,
  3. Removed no longer needed setCancelSyntheticClickEvents(false) from one test suite,
  4. Simplified focus tests to use document.activeElement instead of isFocused helper,
  5. Removed a duplicate toggle button test from the "auto open disabled" test suite.

Type of change

  • Tests

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

import * as settings from '@polymer/polymer/lib/utils/settings.js';
import { close, getFocusedCell, getOverlayContent, idleCallback, open } from './common.js';

settings.setCancelSyntheticClickEvents(false);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer needed here, because we enable it in ElementMixin since #3510

Comment on lines -573 to -576
it('should open by tapping the calendar icon even if autoOpenDisabled is true', async () => {
tap(toggleButton);
await oneEvent(datepicker.$.overlay, 'vaadin-overlay-open');
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this duplicate test, because autoOpenDisabled has no effect on the toggle button.

@web-padawan web-padawan removed the request for review from sissbruecker October 21, 2022 06:27
@web-padawan web-padawan merged commit 3d4723a into master Oct 21, 2022
@web-padawan web-padawan deleted the test/date-picker-rearrange branch October 21, 2022 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants