-
Notifications
You must be signed in to change notification settings - Fork 324
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
Fix pasting tables from Google Sheets; update tests. #10327
Conversation
@@ -52,7 +54,7 @@ class MockClipboardItem { | |||
this.types = Object.keys(data) | |||
} | |||
|
|||
getType(type: string): Blob { | |||
async getType(type: string): Promise<Blob> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async
is not needed if there's no await AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async
is the simplest way to turn the returned Blob
into a Promise
, which is necessary to match the mocked API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use Promise.resolve
but ok.
// clipboard data. We want to avoid false negatives (even if a browser changes its sanitization), and in case of a | ||
// false positive the user is pasting data we don't have any good way to handle, so trying to make a Table from it is | ||
// acceptable. | ||
return /<table[ >]/.test(htmlContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we would like to be case-insensitive, just in case?
Pull Request Description
Part of #10275 (AG Grid support will be a separate PR).
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.