-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat-sequence-id
- Loading branch information
Showing
6 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+3.88 KB
...ent-blob-url-js-file-attachment-with-blob-url-should-be-downloadable-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="https://unpkg.com/react@17.0.2/umd/react.production.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.production.min.js"></script> | ||
<script crossorigin="anonymous" src="/test-harness.js"></script> | ||
<script crossorigin="anonymous" src="/test-page-object.js"></script> | ||
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script> | ||
</head> | ||
<body> | ||
<div id="webchat"></div> | ||
<script> | ||
run(async function () { | ||
const { | ||
Components: { Composer, FileContent } | ||
} = WebChat; | ||
|
||
// TODO: [P2] #2869 When the "DLJS patching code" is being moved to DLJS, we should use standard Web Chat setup, instead of composition mode. | ||
// SETUP: Web Chat using composition mode because the logic which talk to DLJS will strip out blob:// URL. | ||
ReactDOM.render( | ||
React.createElement( | ||
Composer, | ||
{ | ||
directLine: testHelpers.createDirectLineWithTranscript(), | ||
store: testHelpers.createStore() | ||
}, | ||
React.createElement(FileContent, { | ||
fileName: 'blob.txt', | ||
href: URL.createObjectURL(new Blob()) | ||
}) | ||
), | ||
document.getElementById('webchat') | ||
); | ||
|
||
// WHEN: <FileContent href="blob:http://..." /> is being displayed. | ||
await pageConditions.uiConnected(); | ||
|
||
// THEN: The attachment should have a download icon which means the attachment is downloadable. | ||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
test('File attachment with blob URL should be downloadable', () => runHTML('attachment.fileContent.blobURL.html')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
samples/01.getting-started/g.hybrid-react-npm/packages/chat-component/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.