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

feat: add warning theme variant for button #7485

Merged
merged 2 commits into from
Jun 12, 2024
Merged

Conversation

FrediWa
Copy link
Contributor

@FrediWa FrediWa commented Jun 11, 2024

Description

For sake of consistency, this PR adds the warning variant for vaadin-button.

Fixes #5911

Type of change

  • Feature

Checklist

  • I have added tests to ensure my change is effective and works as intended.

Copy link
Contributor

@vursen vursen left a comment

Choose a reason for hiding this comment

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

Please add screenshot tests for this change. You can find an example here:

['contrast', 'success', 'error'].forEach((variant) => {
describe(variant, () => {
it('primary', async () => {
element.setAttribute('theme', `primary ${variant}`);
await visualDiff(div, `theme-primary-${variant}`);
});
it('secondary', async () => {
element.setAttribute('theme', `${variant}`);
await visualDiff(div, `theme-secondary-${variant}`);
});
it('tertiary', async () => {
element.setAttribute('theme', `tertiary ${variant}`);
await visualDiff(div, `theme-tertiary-${variant}`);
});
it('primary disabled', async () => {
element.setAttribute('theme', `primary ${variant}`);
element.disabled = true;
await visualDiff(div, `theme-primary-${variant}-disabled`);
});
it('secondary disabled', async () => {
element.setAttribute('theme', `${variant}`);
element.disabled = true;
await visualDiff(div, `theme-secondary-${variant}-disabled`);
});
it('tertiary disabled', async () => {
element.setAttribute('theme', `tertiary ${variant}`);
element.disabled = true;
await visualDiff(div, `theme-tertiary-${variant}-disabled`);
});
});
});

Copy link

sonarcloud bot commented Jun 11, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@FrediWa FrediWa requested a review from vursen June 11, 2024 13:01
@FrediWa FrediWa merged commit 437d18f into main Jun 12, 2024
9 checks passed
@FrediWa FrediWa deleted the feat/button-warning-variant branch June 12, 2024 08:11
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha4 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add warning variant for vaadin-button
3 participants