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

Bump ember-test-selectors to v6 with fixed tests #937

Merged
merged 8 commits into from
Feb 16, 2022

Conversation

DanMonroe
Copy link
Contributor

This PR has several code changes surrounding attribute bindings.

Once #936 is approved and merged, I'll rebase this PR.

@DanMonroe DanMonroe force-pushed the monroe/et4-test-selectors branch from be406a4 to 33237a2 Compare February 9, 2022 16:25
addon/components/ember-tfoot/template.hbs Outdated Show resolved Hide resolved
addon/components/ember-th/template.hbs Outdated Show resolved Hide resolved
addon/components/ember-thead/template.hbs Outdated Show resolved Hide resolved
tests/integration/components/meta-test.js Outdated Show resolved Hide resolved
addon/components/ember-table/component.js Show resolved Hide resolved
addon/components/-private/simple-checkbox.js Show resolved Hide resolved
To have the data-test attributes removed in a production build,
tie into the setupForTest helper.
@DanMonroe DanMonroe force-pushed the monroe/et4-test-selectors branch from b020b2b to 8386120 Compare February 11, 2022 15:30
Due to an issue with ember-angle-bracket-invocation-polyfill
ember-polyfills/ember-angle-bracket-invocation-polyfill#69
where data attributes are not applied properly to component with existing
attributeBindings. Used class names to select the appropriate table instead.
@DanMonroe DanMonroe requested a review from mixonic February 14, 2022 14:58
@@ -6,22 +6,23 @@
data-test-select-row-container
>
{{-ember-table-private/simple-checkbox
Copy link
Member

Choose a reason for hiding this comment

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

<EmberTablePrivateSimpleCheckbox

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't convert to angle brackets because of the 2.18 expected an implementation for DynamicArg issue

@@ -218,7 +218,8 @@ export default Component.extend({
*/
onResize: null,

'data-test-row-count': readOnly('wrappedRows.length'),
attributeBindings: ['dataTestRowCount:data-test-row-count'],
dataTestRowCount: readOnly('wrappedRows.length'),
Copy link
Member

Choose a reason for hiding this comment

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

The implementations here (thead and in tfoot) for row count binding should match the implementation for tbody?

@DanMonroe DanMonroe requested a review from mixonic February 15, 2022 18:58
Copy link
Member

@mixonic mixonic left a comment

Choose a reason for hiding this comment

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

Ok, I've left some comments for followup, but lets merge this and fix-forward any concerns.

Thank you @DanMonroe for your diligent efforts here, and patience with my feedback 🎉

@@ -5,23 +5,23 @@
class="et-toggle-select {{unless this.shouldShowCheckbox 'et-speech-only'}}"
data-test-select-row-container
>
{{-ember-table-private/simple-checkbox
data-test-select-row=true
{{ember-table-simple-checkbox
Copy link
Member

Choose a reason for hiding this comment

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

The intent of dropping the / in the invocation (by moving the component to the top level) was to allow us to use angle bracket invocation in 3.4 without the polyfill. If angle bracket invocation is not being used here, I don't believe the renaming is strictly necessary.

@@ -218,11 +223,16 @@ export default Component.extend({
*/
onResize: null,

'data-test-row-count': readOnly('wrappedRows.length'),
attributeBindings: ['wrappedRowsCount:data-test-row-count'],
wrappedRowsCount: and('isTesting', 'wrappedRows.length'),
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe this actually stops wrappedRows.length from being a dependency in the chain, which is the goal of a testing mode.

@mixonic mixonic merged commit 04a4e5e into 4.0-beta Feb 16, 2022
@mixonic mixonic deleted the monroe/et4-test-selectors branch February 16, 2022 14:20
This was referenced Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants