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

Create.vue needs migrating to KCheckbox #4492

Closed
akolson opened this issue Mar 29, 2024 · 4 comments · Fixed by #4503
Closed

Create.vue needs migrating to KCheckbox #4492

akolson opened this issue Mar 29, 2024 · 4 comments · Fixed by #4503

Comments

@akolson
Copy link
Member

akolson commented Mar 29, 2024

Observed behavior

This is a follow up issue on #4472

contentcuration/contentcuration/frontend/accounts/pages/__tests__/create.spec.js fails to run during tests execution when migrated to KCheckbox. It's likely related to the rules and hide-details props that have been removed from the Checkbox.vue component and yet are used in the Create.vue component.

<Checkbox
v-model="acceptedAgreement"
:label="$tr('agreement')"
required
:rules="tosAndPolicyRules"
:hide-details="false"
class="my-1 policy-checkbox"
/>

The work around was to use the VCheckbox instead of the Checkbox, since it has the props in question.

Expected behavior

  • The Create component should be migrated to KCheckbox
  • The failing tests should run and pass.

User-facing consequences

None

Errors and logs

FAIL contentcuration/contentcuration/frontend/accounts/pages/__tests__/create.spec.js
  ● Test suite failed to run

    Call retries were exceeded

      at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)

Additional information

We don't need to implement hide-details or rules necessarily. Since this page is the only place where we're using checkbox rules, we can just implement the validation directly in the component. Additionally, it needs to display the error message underneath the field, which hide-details=false allows space for.

Steps to reproduce the issue

@akolson akolson added this to the Studio: upcoming patches milestone Mar 29, 2024
@bjester bjester changed the title accounts/pages/__tests__/create.spec.js fails to run after migrating to KCheckbox Create.vue needs migrating to KCheckbox Mar 29, 2024
@MisRob
Copy link
Member

MisRob commented Apr 1, 2024

@EshaanAgg @akolson Do we need to make some updates to KDS or can KCheckbox be used as is to complete this issue?

@EshaanAgg
Copy link
Contributor

I don't think so we need make changes to the KCheckbox component. We can refactor Create.vue to manually check that the Policy checkbox is checked before submitting.

@MisRob
Copy link
Member

MisRob commented Apr 2, 2024

Okay, thanks for info

@marcellamaki
Copy link
Member

Closed with #4503

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

Successfully merging a pull request may close this issue.

4 participants