Skip to content

Conversation

@jpuzz0
Copy link
Contributor

@jpuzz0 jpuzz0 commented Mar 14, 2022

What: Closes #7046

@patternfly-build
Copy link
Collaborator

patternfly-build commented Mar 14, 2022

@jpuzz0 jpuzz0 force-pushed the chore/rtl-migrate-bundle-6 branch from 77e8749 to 66eb2c7 Compare March 14, 2022 20:29
@nicolethoen nicolethoen self-requested a review April 11, 2022 19:02
@jpuzz0 jpuzz0 force-pushed the chore/rtl-migrate-bundle-6 branch from 66eb2c7 to cbe1904 Compare April 13, 2022 15:33
@tlabaj tlabaj self-requested a review April 13, 2022 15:45
@jpuzz0 jpuzz0 force-pushed the chore/rtl-migrate-bundle-6 branch from cbe1904 to ea14d7d Compare April 13, 2022 15:56
progressAriaLabel?: string;
/** Associates the ProgressBar with it's label for accessibility purposes. Required when title not used */
progressAriaLabelledBy?: string;
/** Unique identifier for Progress. Generated if not specified. */
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. lowercase for progress here.
It also looks like the id is not generated.

Copy link
Contributor Author

@jpuzz0 jpuzz0 Apr 14, 2022

Choose a reason for hiding this comment

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

It doesn't get generated in this file, but it does inside of Progress, where we pass progressId to the id prop and this the logic in that component:

I could rephrase and say something like Generated inside of Progress if not specified.?

In terms of the case of progress, I assumed it to be capitalized as it's referring to the component, just as the above comment on line 46 refers to ProgressBar in similar TitleCase.

Copy link
Contributor

Choose a reason for hiding this comment

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

The above should probably be in sentence case too, "progress bar".
I think the comment is fine as is for the progressId.

test('in the DISCONNECTED state', () => {
const { asFragment } = render(
<SerialConsole
onData={jest.fn()}
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that the myIdPrefix is something that may be prepended in multiple places, I think we may want to keep it in these testss

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checked the props and XTermProps which are extended for SerialConsole and neither allow for an id;
image

Copy link
Contributor

Choose a reason for hiding this comment

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

weird... ok

extraParams: { onSelect }
};
const returnedData = selectable('', { column, rowIndex: 0, rowData: { selected: true } } as IExtra);
expect(returnedData).toMatchObject({ className: 'pf-c-table__check' });
Copy link
Contributor

Choose a reason for hiding this comment

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

here you did delete the aspect of the test that verified that the selecting event handlers are getting triggered on click. Should we either make a new test to verify that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't recall why I removed those. Probably wasn't clear what was trying to be tested as they just read "selected" and "main select". I can add some userEvents back in here to check for the same things.

}
];

actionConfigs.forEach(testCellActions);
Copy link
Contributor

Choose a reason for hiding this comment

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

The actions are dynamically built in the table, so testing that they are built and firing the right events at the right times is probably something we should keep.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of these iterated tests in transformers made much sense to me, so I can take another look, and I recall trying to get these to work, but might be something I make a separate story in our backlog for to address later.

Copy link
Contributor

Choose a reason for hiding this comment

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

that'd be fine if you end up doing that i think

});
});

describe('SVGDefsSetter', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we open an issue documenting that this test was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll take another look before doing so, but probably will end up doing that.

@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SVGDefs should get #addDef and #removeDef from context 1`] = `<DocumentFragment />`;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is an empty snapshot? is it service a purpose?

Copy link
Contributor Author

@jpuzz0 jpuzz0 Apr 14, 2022

Choose a reason for hiding this comment

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

Managed to come up with something for this, SVGDefsSetter, and the one from transformers. Please see updates in latest commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Long story short for the SVGDefs test; Verifying functions are called on mount and on unmount implicitly prove the context props are passed down appropriately.

@nicolethoen nicolethoen merged commit 830acb1 into patternfly:main Apr 18, 2022
@patternfly-build
Copy link
Collaborator

Your changes have been released in:

  • eslint-plugin-patternfly-react@4.42.1
  • @patternfly/react-catalog-view-extension@4.54.1
  • @patternfly/react-charts@6.56.1
  • @patternfly/react-code-editor@4.44.1
  • @patternfly/react-console@4.54.1
  • @patternfly/react-core@4.203.1
  • @patternfly/react-docs@5.64.1
  • @patternfly/react-icons@4.54.1
  • @patternfly/react-inline-edit-extension@4.48.1
  • demo-app-ts@4.163.1
  • @patternfly/react-integration@4.165.1
  • @patternfly/react-log-viewer@4.48.1
  • @patternfly/react-styles@4.53.1
  • @patternfly/react-table@4.72.1
  • @patternfly/react-tokens@4.55.1
  • @patternfly/react-topology@4.50.1
  • @patternfly/react-virtualized-extension@4.50.1
  • transformer-cjs-imports@4.41.1

Thanks for your contribution! 🎉

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.

Migrate tests to RTL (6)

5 participants