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

Disable format button without Prettier applied #3545

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

wmarques
Copy link
Contributor

Fix #3278

@@ -370,7 +370,8 @@ describe('Landscape', () => {
const [appliedModules] = modules.applyAll.lastCall.args as ModulesToApply[];
expect(appliedModules.modules.map(slug => slug.get())).toEqual(['vue']);
expect(wrapper.find(wrappedElement('modules-apply-new-button')).attributes('disabled')).toBeDefined();

const component: any = wrapper.vm;
expect(component.isApplied('vue')).toBeTruthy();
Copy link
Member

Choose a reason for hiding this comment

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

maybe another assert with a not applied one?

@wmarques
Copy link
Contributor Author

The tests are failing because the "Format" Button are disabled by default, as "Prettier" is not applied, I see two ways:

  • Mock "isApplied" function to always return true
  • Click on "Prettier" in each failing test to enable the format button

Which one is better ?
cc @hdurix

@wmarques wmarques force-pushed the disable-format-prettier branch from f77ba2e to d4fa0a4 Compare September 14, 2022 15:34
@hdurix
Copy link
Member

hdurix commented Sep 14, 2022

@wmarques I tried to fix it with a PR on this PR: wmarques#1

is it what you intended?

@wmarques
Copy link
Contributor Author

Yes indeed ! Thanks ! I'll fix merge conflict tomorrow and hope it will be good

@wmarques wmarques force-pushed the disable-format-prettier branch from 926e9c6 to c13f2a4 Compare September 15, 2022 08:03
@wmarques wmarques force-pushed the disable-format-prettier branch from c13f2a4 to 641f1a0 Compare September 15, 2022 08:37
@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (641f1a0) compared to base (cb52285).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##                main     #3545   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity      2010      2010           
===========================================
  Files            529       529           
  Lines           8714      8719    +5     
  Branches         171       172    +1     
===========================================
+ Hits            8714      8719    +5     
Impacted Files Coverage Δ
...pp/module/primary/landscape/Landscape.component.ts 100.00% <100.00%> (ø)
...rimary/project-actions/ProjectActions.component.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pascalgrimaud pascalgrimaud merged commit 3ebe37d into jhipster:main Sep 15, 2022
@wmarques wmarques deleted the disable-format-prettier branch September 16, 2022 08:23
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.

Disable format button without prettier module
3 participants