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

[tests-only] Add unit tests for the text editor #8002

Merged
merged 3 commits into from
Nov 24, 2022

Conversation

JammingBen
Copy link
Contributor

This also includes a mock for the useAppDefaults composable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

@JammingBen JammingBen self-assigned this Nov 18, 2022
@JammingBen
Copy link
Contributor Author

SonarCloud fails because of 0.0% condition coverage... makes sense 🤡
image

Copy link
Member

@dschmidt dschmidt left a comment

Choose a reason for hiding this comment

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

I like, can we add this to stable instead?

@JammingBen JammingBen force-pushed the add-text-editor-unit-tests branch from 98cc316 to 6f7cb99 Compare November 21, 2022 08:15
@JammingBen JammingBen changed the base branch from master to stable-6.0 November 21, 2022 08:17
@JammingBen JammingBen marked this pull request as ready for review November 21, 2022 10:32
@JammingBen JammingBen added the Status:Needs-Review Needs review from a maintainer label Nov 21, 2022
const defaultMocks = { ...defaultComponentMocks() }
const storeOptions = { ...defaultStoreMockOptions }
const localVue = defaultLocalVue()
const store = createStore(Vuex.Store, storeOptions)
Copy link
Member

Choose a reason for hiding this comment

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

Out of scope for this PR, but:

I don't like that you use options from test helpers but have to add vuex-extensions to the package dependencies, I would like to see this handled in web-test-helpers completely.
We should really throw some time at unit tests at some point, unify the setup and clean up stuff like this.

import { GetFileContentsResponse } from 'web-client/src/webdav/getFileContents'
import { AppConfigObject, FileContext, useAppDefaults } from 'web-pkg/src'

export const useAppDefaultsMock = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Still amazed by the mocks with the partial type for options 😎

packages/web-app-text-editor/tests/unit/app.spec.ts Outdated Show resolved Hide resolved
@JammingBen JammingBen force-pushed the add-text-editor-unit-tests branch from 30817cc to 5c52f8d Compare November 24, 2022 09:20
@JammingBen JammingBen requested a review from kulmann November 24, 2022 09:20
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

66.7% 66.7% Coverage
0.0% 0.0% Duplication

@JammingBen JammingBen merged commit 0ee1c4b into stable-6.0 Nov 24, 2022
@delete-merged-branch delete-merged-branch bot deleted the add-text-editor-unit-tests branch November 24, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Needs-Review Needs review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants