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(editor): Increase test coverage for users settings page and modal #10623

Merged

Conversation

r00gm
Copy link
Contributor

@r00gm r00gm commented Aug 30, 2024

Summary

This were more like and e2e test disguised as an Unit test.

Separated it into two so each one test their own logic.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/PAY-1904/increaser-test-coverage-for-users-settings-page

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@r00gm r00gm changed the title Pay 1904 increaser test coverage for users settings page test(editor): Increaser test coverage for users settings page and modal Aug 30, 2024
@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Aug 30, 2024
@r00gm r00gm changed the title test(editor): Increaser test coverage for users settings page and modal test(editor): Increase test coverage for users settings page and modal Aug 30, 2024
@r00gm r00gm marked this pull request as ready for review August 30, 2024 11:28
@r00gm r00gm requested a review from cstuncsik August 30, 2024 11:28
Copy link
Member

@alexgrozav alexgrozav left a comment

Choose a reason for hiding this comment

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

Awesome work! 🎉 Few small remarks.

packages/editor-ui/src/components/DeleteUserModal.test.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/views/SettingsUsersView.test.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/views/SettingsUsersView.test.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/__tests__/utils.ts Show resolved Hide resolved
packages/editor-ui/src/components/DeleteUserModal.test.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/components/DeleteUserModal.test.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/components/DeleteUserModal.test.ts Outdated Show resolved Hide resolved
}
: ReturnType<TStoreDef> => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return useStore() as any;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can omit type casting here to any, or if you want to do it, it could be TStoreDef

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this method is copy pasted from the documentation, but anyway i tried and it needs to be any.

the important part is that when used it correctly infers the store types

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought just to avoid using eslint disable comment because we're not using any

Copy link
Contributor

Choose a reason for hiding this comment

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

And it is likely doesn't matter since the return type of the function already defined as ReturnType<TStoreDef>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i agree but it doesn't work :(

@r00gm r00gm requested review from alexgrozav and cstuncsik August 30, 2024 12:28
Copy link

cypress bot commented Aug 30, 2024

n8n    Run #6688

Run Properties:  status check passed Passed #6688  •  git commit 894946cbbf: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 r00gm 🗃️ e2e/*
Project n8n
Branch Review pay-1904-increaser-test-coverage-for-users-settings-page
Run status status check passed Passed #6688
Run duration 05m 14s
Commit git commit 894946cbbf: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 r00gm 🗃️ e2e/*
Committer r00gm
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 422
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@r00gm r00gm merged commit a20c915 into master Aug 30, 2024
55 of 81 checks passed
@r00gm r00gm deleted the pay-1904-increaser-test-coverage-for-users-settings-page branch August 30, 2024 14:45
MiloradFilipovic added a commit that referenced this pull request Sep 2, 2024
* master:
  fix(core): Flush responses for ai streaming endpoints (#10633)
  fix: Re-enable infra provisioning and teardown (no-changelog) (#10636)
  feat(core): Execution curation (#10342)
  fix(Webhook Node): Add tests for utils (no-changelog) (#10613)
  fix: Fixes to cloud benchmarks (no-changelog) (#10634)
  test: Add JS CodeNode benchmark scenario (#10632)
  refactor(editor): Migrate `MainSidebar.vue` to composition API (no-changelog) (#10538)
  build: Fix `cli` nodemon config (#10628)
  docs: Add 'benchmark' scope to PR Title Conventions documentation (#10624)
  ci: Fixes to benchmarks in cloud (#10626)
  test(editor): Increase test coverage for users settings page and modal (#10623)
  fix(Wait Node): Append n8n attribution option (#10585)
  refactor(editor): Migrate `NodeSettings.vue` to composition API (#10545)
  fix(editor): Add pinned data only to manual executions in execution view (#10605)
  ci: Omit benchmark scope commits from changelog (no-changelog) (#10618)
  fix: Disable errors obfuscation (no-changelog) (#10617)
  ci: Fix script name in gh workflow (#10619)
  ci: Fix nightly image not being pushed to ghcr (#10620)
@janober
Copy link
Member

janober commented Sep 5, 2024

Got released with n8n@1.58.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants