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

Improve test readability, use schema labels for membership tokens #21708

Merged
merged 1 commit into from
Oct 3, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Oct 3, 2021

Overview

Improve test readability, use schema labels for membership tokens

Before

  1. Tests hard to read as it's not clear what tokens the output relates to
  2. Membership tokens do not have the same labels as the schema

After

above are fixed

Technical Details

You could argue whether the schema labels or the hard-coded labels are more intuitive but I think that question should be phrased as 'should the schema labels be updated' rather than what is being addressed here 'should the labels match the schema titles for the fields'

Comments

@civibot
Copy link

civibot bot commented Oct 3, 2021

(Standard links)

@civibot civibot bot added the master label Oct 3, 2021
@eileenmcnaughton eileenmcnaughton force-pushed the test_clean branch 2 times, most recently from 6cc385a to a59d113 Compare October 3, 2021 01:58
@eileenmcnaughton eileenmcnaughton changed the title Test clean Improve test readability, use schema labels for membership tokens Oct 3, 2021
@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

@colemanw @demeritcowboy can I get a merge on this - it changes tests for readability but has a lot of 'noise'

@demeritcowboy
Copy link
Contributor

I think this is ok. This is the only place this comes up right?

Untitled

' . CRM_Utils_Date::customFormat($this->case['modified_date']) . '
return 'case.id :1
case.case_type_id:label :Housing Support
case.subject :Case Subject
Copy link
Contributor

Choose a reason for hiding this comment

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

The colon spacing seems odd but not a blocker. I can see that if the token contains a colon it would look just as weird to have it stuck to the left side. Maybe some other character? e.g. case.case_type_id:label | Housing Support

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@demeritcowboy no - you have no idea how much pain it took to get to this point - please don't make me change it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also fyi I originaly had a space either side of the : - what happened was the IDE kept stripping it & I spent hours staring at strings to figure out how they were different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks!

@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy yep re the member label

@demeritcowboy demeritcowboy merged commit 670772d into civicrm:master Oct 3, 2021
@eileenmcnaughton eileenmcnaughton deleted the test_clean branch October 3, 2021 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants