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

Port spec for Datetimepicker #73

Merged
merged 1 commit into from
Sep 16, 2023
Merged

Conversation

kikuomax
Copy link
Collaborator

@kikuomax kikuomax commented Sep 4, 2023

Part of the series of PRs to port unit tests.

The following command should pass:

npx jest src/components/datetimepicker

You will see the following warning while running the tests. This is due to the issue #23 but should not matter to the test results.

[Vue warn]: Failed to resolve component: b-input

Related to:

Proposed Changes

  • Port spec for Datetimepicker

- Updates the unit tests (spec) of `Datetimepicker` so that they can
  work with Vue 3 and `@vue/test-utils` V2:
    - Corrects v-model bindings:
        - property: `value` → `modelValue`
        - event: `input` → `update:modelValue`
    - Sets the locale "en-US" to produce predictable outputs. Replaces
      the expected outputs because I was not able to reproduce the old
      values:
        - "2019-10-1 08:30" → "10/1/2019, 8:30 AM"
    - Replaces `wrapper.find` with `findComponent` because `find` is
      dedicated to DOM elements on `@vue/test-utils` V2.
    - Awaits `wrapper.setProps` to make sure the subsequent tests verify
      the updated state.
    - Replaces `wrapper.name()` with `wrapper.vm.$options.name` because
      `wrapper.name` no longer exists in `@vue/test-utils` V2.
    - Replaces the test on `wrapper.isVueInstance()` with presence of
      `wrapper.vm` because `wrapper.isVueInstance` no longer exists in
      `@vue/test-utils` V2.
    - Replaces `propsData` option for `shallowMount` or `mount` with
      `props` because `propsData` might be deprecated in the future.
    - Makes `transition` a stub because whether `transition` is a stub
      or not does not matter to the test results.
    - Removes `sync` option for `mount`, because it has no effect and is
      unnecessary on `@vue/test-utils` V2.
    - We see warnings until we fix the issue ntohq#23

issue ntohq#1
@wesdevpro wesdevpro merged commit 36541d0 into ntohq:dev Sep 16, 2023
@kikuomax kikuomax deleted the test-datetimepicker branch September 18, 2023 01:39
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