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

WPT test suite needs updating to match spec + implementations #405

Open
stephenmcgruer opened this issue Dec 14, 2022 · 0 comments
Open

Comments

@stephenmcgruer
Copy link
Collaborator

When working on #404 , I discovered that the PaymentHandler test suite is unfortunately quite far diverged from both spec and implementation currently (and the implementation is somewhat diverged from the spec too).

A short list of problems I found in my initial pass of the test suite (but there may be others!):

  • Tests treat supportedMethods as a list still, not a string
  • Tests assert that additionalDisplayItems and total are not in modifiers for "canmakepaymentevent", which they are in Chrome's implementation
  • Tests assert that modifier.data exists for "canmakepaymentevent", and it doesn't seem to for Chrome
  • Tests presume that "canmakepaymentevent" affects canMakePayment(), not hasEnrolledInstrument()
  • Tests presume that if "canmakepaymentevent" returns false, then show() will throw a NotSupportedError
  • Tests try to reject the "canmakepaymentevent" respondWith with Error objects that have actual messages, which is not supported afaik (maybe they silently become false?)

Some of these may be actual bugs in Chrome, whilst some reflect how both the PaymentHandler spec and test suite have diverged from changes in both PaymentRequest spec and in the reality of the Chrome implementation. In all worlds, the test suite (and spec) desperately needs some TLC to at least reflect the shipping reality!

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

No branches or pull requests

1 participant