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

Update SIA R67 #272

Merged
merged 19 commits into from
Jun 29, 2020
Merged

Update SIA R67 #272

merged 19 commits into from
Jun 29, 2020

Conversation

Jym77
Copy link
Contributor

@Jym77 Jym77 commented Jun 22, 2020

@Jym77 Jym77 requested a review from kasperisager as a code owner June 22, 2020 11:37
Copy link
Contributor

@kasperisager kasperisager left a comment

Choose a reason for hiding this comment

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

Looks good! 👍 Just a comment on the spec.

Comment on lines +42 to +45
const emptyAlt = getById("empty-alt");
const roleNone = getById("role-none");
const rolePresentation = getById("role-presentation");
const svg = getById("svg");
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be done using destructuring and without additional helpers and need for IDs:

const [img, video, object, svg] = document
  .first()
  .get()
  .children()
  .filter(Element.isElement);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, but this is less resilient to changes in the HTML.
Additionally, ids are commenting (in the HTML) what this target is testing, and can be handy for debugging messages from inside the rule itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's reasonable 👍 What we need then is a unified approach to this rather than ad-hoc helpers scattered throughout rule spec files. Test code is most annoying code to maintain so it needs to be super maintainable 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I totally agree. If we decide that IDs + getter is the way we wanna go, we should of course make the helper common and update existing tests to use it…
I've also been considering writing a wrapper for Document.of+Element.fromElement that we seem to use pretty often in tests…

Copy link
Contributor

Choose a reason for hiding this comment

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

#281 should hopefully help on the last point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it gets a bit better. Still need to

Document.fromDocument(
  h.document([
    <html>
      <head>
        <title>Hello world</title>
      </head>
    </html>
  ])
);

instead of

documentFromHtml(<html>
      <head>
        <title>Hello world</title>
      </head>
    </html>);

@@ -261,7 +261,7 @@ export namespace Role {
// ...and it's not a presentational role in a forbidden context...
!(
role.some(Role.isPresentational) &&
!isAllowedPresentational
!allowedPresentational
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🙈

Comment on lines +42 to +45
const emptyAlt = getById("empty-alt");
const roleNone = getById("role-none");
const rolePresentation = getById("role-presentation");
const svg = getById("svg");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I totally agree. If we decide that IDs + getter is the way we wanna go, we should of course make the helper common and update existing tests to use it…
I've also been considering writing a wrapper for Document.of+Element.fromElement that we seem to use pretty often in tests…

@Jym77 Jym77 dismissed kasperisager’s stale review June 23, 2020 09:37

Fixed a nasty bug + updated to latest Sanshika

@Jym77 Jym77 requested a review from kasperisager June 23, 2020 09:37
@Jym77 Jym77 self-assigned this Jun 25, 2020
@kasperisager kasperisager added the patch Backwards-compatible change that doesn't touch public API label Jun 29, 2020
@Jym77 Jym77 merged commit 296faa3 into master Jun 29, 2020
@Jym77 Jym77 deleted the update-sia-r67 branch June 29, 2020 11:46
kasperisager added a commit that referenced this pull request Jun 29, 2020
kasperisager added a commit that referenced this pull request Jul 1, 2020
* master: (21 commits)
  Rework the way DOM parent pointers are handled (#283)
  Create a GitHub release as part of release workflow
  Backtrack on shortcut links
  v0.3.0
  Prepare release
  Update changelog
  Update changelog
  `RoleOptions#allowPresentational` must be optional
  Update SIA R67 (#272)
  Update lockfile
  Correctly resolve important and overridden CSS properties (#282)
  Introduce HyperScript-like DSL for constructing DOM (#281)
  Use dynamic import rather than `require()` for loading formatters (#278)
  Add `Future#get()` and accept thunked promises in `Future.from()` (#279)
  Fix default argument type parameter of several types
  Speedup table building (#276)
  Add initial support for `background` shorthand property (#277)
  Output stack in CLI errors if available
  Chesterton's fence strikes again!
  Correctly pull `.message` from expectations
  ...
@kasperisager
Copy link
Contributor

Just a heads up, @singingknight, that this is not ready for the platform yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Backwards-compatible change that doesn't touch public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants