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

Use stimulus controller for dependent checkboxes and add specs #994

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

njaeggi
Copy link
Contributor

@njaeggi njaeggi commented Sep 19, 2024

Copy link
Member

@TheWalkingLeek TheWalkingLeek left a comment

Choose a reason for hiding this comment

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

Mir sind beim Durchtesten noch zwei Dinge aufgefallen:

  1. Ich kann als normaler Nutzer soweit ich sehe nie auf den TerminateSacMembershipWizard navigieren. Im Dropdown wird ein can? für die Wizard Konstante aufgerufen aber der Wizard hat keine Ability => gibt immer false https://github.com/hitobito/hitobito_sac_cas/blob/master/app/helpers/dropdown/people/memberships.rb#L37
  2. Ich kann das "Daten aufbewahren" Checkmark einfach händisch wieder abwählen. So kann ein Zustand entstehen, bei dem der "Daten aufbewahern" unchecked und zB "Spenden" checked. Soll das so? Wenn nicht müsste man das wohl im UI locken und es bräuchte eine Backend Validierung


- stimulus_ctrl = 'form-field-check-dependent'
%div{data: { controller: stimulus_ctrl }}
- if current_user.backoffice? and c.model.mitglied_termination_by_section_only?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- if current_user.backoffice? and c.model.mitglied_termination_by_section_only?
- if current_user.backoffice? && c.model.mitglied_termination_by_section_only?

expect(find("#wizards_memberships_terminate_sac_membership_wizard_summary_data_retention_consent")).not_to be_checked
end

it "check newsletter and sac spenden uncheck one, doesnt uncheck data_retention_consent" do
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
it "check newsletter and sac spenden uncheck one, doesnt uncheck data_retention_consent" do
it "do not uncheck data_retention_consent when unchecking newsletter or sac spenden" do

check "Ich möchte weiterhin über Spendenaktionen informiert werden."
expect(find("#wizards_memberships_terminate_sac_membership_wizard_summary_data_retention_consent")).to be_checked
uncheck "Newsletter beibehalten"
expect(find("#wizards_memberships_terminate_sac_membership_wizard_summary_data_retention_consent")).to be_checked
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
expect(find("#wizards_memberships_terminate_sac_membership_wizard_summary_data_retention_consent")).to be_checked
expect(find("#wizards_memberships_terminate_sac_membership_wizard_summary_data_retention_consent")).to be_checked
uncheck "Ich möchte weiterhin über Spendenaktionen informiert werden."
expect(find("#wizards_memberships_terminate_sac_membership_wizard_summary_data_retention_consent")).to be_checked

Noch testen obs beim anderen Feld auch so ist

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.

MEMBERSHIP: Austritt "Aufbewahrung deiner Daten" und "SAC Spenden" werden nicht berücksichtigt
2 participants