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

A11-2660 refactor and add ClickableText tests #1561

Merged
merged 7 commits into from
Oct 30, 2023
Merged

Conversation

charbelrami
Copy link
Contributor

Restructures the ClickableText spec, improves the descriptions for better understanding, adds tests.

@linear
Copy link

linear bot commented Oct 26, 2023

A11-2660 Write tests for ClickableText

type (button/link rendering), disabled state

@charbelrami charbelrami requested review from a team and bcardiff and removed request for a team October 26, 2023 15:34
Copy link
Member

@bcardiff bcardiff left a comment

Choose a reason for hiding this comment

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

Feel free to merge directly. My comments are optional/discussions.

@@ -1,72 +1,411 @@
module Spec.Nri.Ui.ClickableText exposing (spec)
module Spec.Nri.Ui.ClickableText exposing (..)
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to expose everything instead of the top level spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that was unintended

helpfullyDisabledClickableText : List Test
helpfullyDisabledClickableText =
[ test "does not have `aria-disabled=\"true\" when not disabled" <|
type Type_
Copy link
Member

Choose a reason for hiding this comment

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

Nothing against this Type_, but from I can see having programLink and programButton functions would be enough today. Are there any plans in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no plans! Updated!


testAsButton : Test
testAsButton =
test "the `button` type renders as a button element" <|
Copy link
Member

Choose a reason for hiding this comment

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

I think we usually nest describes and tests directly. Is there a reason to flatten the specs and organizing them as proposed?

I checked on our elm style guide and there is nothing against but it seems like a deviation from what we usually do, so I wonder the motivations in case I am missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no specific reason, I just thought it would look cleaner, but don't feel strongly. Updated!

@charbelrami
Copy link
Contributor Author

thank you @bcardiff !

@charbelrami charbelrami merged commit abe355e into master Oct 30, 2023
5 checks passed
@charbelrami charbelrami deleted the clickabletext-tests branch October 30, 2023 17:03
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