browser-compat-data icon indicating copy to clipboard operation
browser-compat-data copied to clipboard

Notification.requestPermission() - add version for returning Promise

Open hamishwillee opened this issue 1 year ago • 3 comments

Notification.requestPermission() originally had a callback, but that is deprecated and it returns a promise. This updates the versions in which promise support was added. Chrome and FF tested in Browserstack. Safari information comes from the existing parent feature.

This is related to fixes for https://github.com/mdn/content/issues/34945

hamishwillee avatar Jul 22 '24 01:07 hamishwillee

I don't understand why this failed.

hamishwillee avatar Jul 22 '24 01:07 hamishwillee

hmm it looks like the tests for the walker use the Notification API data... https://github.com/mdn/browser-compat-data/blob/main/utils/walk.test.ts#L45. @queengooborg should we update the tests or fix the tests to not do that at all? Seems like Notification.json was stable enough so far but it could happen again.

Elchi3 avatar Jul 22 '24 10:07 Elchi3

We should definitely update the tests to not rely on real BCD data, and instead give them some dummy test data. Doing so would also give us the opportunity to test things like the obsolete feature linter.

For now, we should probably just do the simple solution: just modify utils/walk.test.ts and bump the results.length assertions by one so this PR isn't blocked?

queengooborg avatar Jul 23 '24 06:07 queengooborg