Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

radio button fixture and tests #182

Merged
merged 7 commits into from
Jan 11, 2021
Merged

Conversation

Blackbaud-ErikaMcVey
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 3, 2020

Codecov Report

Merging #182 (51e2962) into master (dbca922) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #182   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           29        29           
  Lines          884       884           
  Branches       169       169           
=========================================
  Hits           884       884           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbca922...51e2962. Read the comment docs.

@blackbaud-ado
Copy link
Member

@blackbaud-ado
Copy link
Member

Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush left a comment

Choose a reason for hiding this comment

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

For MVP, we should probably simplify the API to:

get value
set value
get disabled
set disabled

...unless there's a requirement I'm not thinking of?

* Get the value of the radio button at the given index.
* @param index The index of the radio button.
*/
public getRadioButtonValue(index: number): any {

Choose a reason for hiding this comment

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

I'd rename this to getValueByIndex to make the method name more descriptive.

Also, this method feels a bit odd to me. Is there a current customer requirement to get the value of a given radio button in a group? I feel like setting the radio group to a specific value, and retrieving the value of the radio group would suffice?

/**
* A flag indicating if every radio button in the radio group is disabled.
*/
public get allRadioButtonsDisabled(): boolean {

Choose a reason for hiding this comment

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

For MVP, we should assume the consumer is using the radio group "properly", by wrapping all radio buttons within a sky-radio-group. That being the case, we could simplify all of the "disabled" properties to: get disabled and set disabled (since all radio buttons would be disabled if the parent radio group is disabled).

(We could even throw an error if a sky-radio-group isn't found.)

* The text of the radio button at the given index.
* @param index The index of the radio button.
*/
public getRadioButtonLabelText(index: number): string {

Choose a reason for hiding this comment

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

Based on the feedback above, we could rename this to getLabelTextByIndex.

Choose a reason for hiding this comment

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

Also, is there a current MVP request for this functionality?

* Select the radio button with the given index.
* @param index The index of the radio button.
*/
public selectRadioButtonInputElByIndex(index: number): void {

Choose a reason for hiding this comment

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

Couldn't this method be removed and a simple set value be used instead?

@blackbaud-ado
Copy link
Member

@blackbaud-ado
Copy link
Member

@Blackbaud-ErikaMcVey Blackbaud-ErikaMcVey merged commit 5c2a637 into master Jan 11, 2021
@Blackbaud-ErikaMcVey Blackbaud-ErikaMcVey deleted the radio-btn-fixture branch January 11, 2021 15:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants