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

adding data-test-subj to buttons and updating snapshots #20080

Merged

Conversation

bmcconaghy
Copy link
Contributor

Closes #19968. Adding data-test-subj attributes to support functional tests.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

I only reviewed the code; I didn't run this locally. I had one suggestion for making maintenance easier but otherwise this LGTM!

@@ -24,19 +24,19 @@ export class LicenseStatus extends React.PureComponent {
if (isExpired) {
icon = <EuiIcon color="danger" type="alert" />;
message = (
<span>
<span data-test-subj="licenseSubText">
Copy link
Contributor

Choose a reason for hiding this comment

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

It might make maintenance easier if we dedupe these three span elements by changing them to Fragments like this:

    if (isExpired) {
      icon = <EuiIcon color="danger" type="alert" />;
      message = (
        <Fragment>
          Your license expired on <strong>{expiryDate}</strong>
        </Fragment>
      );
      title = `Your ${type} license has expired`;
    } else {
      icon = <EuiIcon color="success" type="checkInCircleFilled" />;
      message = expiryDate ? (
        <Fragment>
          Your license will expire on <strong>{expiryDate}</strong>
        </Fragment>
      ) : (
        <Fragment>
          Your license will never expire.
        </Fragment>
      );
      title = `Your ${type} license is ${status.toLowerCase()}`;
    }

And then instantiate the span itself on line 70 like this:

    <EuiText color="subdued">
      <span data-test-subj="licenseSubText">
        {message}
      </span>
    </EuiText>

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Code LGTM

@jen-huang
Copy link
Contributor

Don't forget version labels 🙂

@bmcconaghy
Copy link
Contributor Author

Thx @jen-huang done. Wish this would happen in some automated fashion -- I will always forget to do this.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@bmcconaghy bmcconaghy merged commit aa4cf42 into elastic:master Jun 20, 2018
bmcconaghy added a commit to bmcconaghy/kibana that referenced this pull request Jun 20, 2018
* adding data-test-subj to buttons and updating snapshots

* PR feedback

* updating snapshots
bmcconaghy added a commit that referenced this pull request Jun 20, 2018
)

* adding data-test-subj to buttons and updating snapshots

* PR feedback

* updating snapshots
bmcconaghy added a commit to bmcconaghy/kibana that referenced this pull request Jun 20, 2018
* adding data-test-subj to buttons and updating snapshots

* PR feedback

* updating snapshots
bmcconaghy added a commit that referenced this pull request Jun 20, 2018
)

* adding data-test-subj to buttons and updating snapshots

* PR feedback

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

Successfully merging this pull request may close these issues.

4 participants