Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- Migrated to radio button for like/dislike where form submission is required
- Fixed long citation identifiers break activity layout, in PR [#5507](https://github.com/microsoft/BotFramework-WebChat/pull/5507), by [@OEvgeny](https://github.com/OEvgeny)
- Updated file-based import with `.js` extension and removed the file extension from build config, by [@compulim](https://github.com/compulim), in PR [#5516](https://github.com/microsoft/BotFramework-WebChat/pull/5516)
- Fixed [#5518](https://github.com/microsoft/BotFramework-WebChat/issues/5518). Minimal bundled build should work properly, in PR [#5507](https://github.com/microsoft/BotFramework-WebChat/pull/5507), by [@compulim](https://github.com/compulim)

# Removed

Expand Down
53 changes: 53 additions & 0 deletions __tests__/html2/basic/bundle/es5.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<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>
<main id="webchat"></main>
<script>
run(async function () {
const {
testHelpers: { createDirectLineEmulator }
} = window;

const { directLine, store } = createDirectLineEmulator();

WebChat.renderWebChat({ directLine, store }, document.getElementById('webchat'));

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity({
from: {
id: 'bot',
role: 'bot'
},
text: 'Hello, World!',
type: 'message'
});

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');

const metaMap = new Map(
Array.from(document.querySelectorAll('meta'))
.filter(element => element.name.startsWith('botframework-webchat'))
.map(element => [element.name, element.getAttribute('content')])
);

expect(metaMap.has('botframework-webchat:api')).toBe(true);
expect(metaMap.get('botframework-webchat:bundle:variant')).toBe('full-es5');
expect(metaMap.has('botframework-webchat:bundle:version')).toBe(true);
expect(metaMap.has('botframework-webchat:bundle')).toBe(true);
expect(metaMap.has('botframework-webchat:component')).toBe(true);
expect(metaMap.has('botframework-webchat:core:version')).toBe(true);
expect(metaMap.has('botframework-webchat:core')).toBe(true);
expect(metaMap.has('botframework-webchat:ui:version')).toBe(true);
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions __tests__/html2/basic/bundle/full.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat.js"></script>
</head>
<body>
<main id="webchat"></main>
<script>
run(async function () {
const {
testHelpers: { createDirectLineEmulator }
} = window;

const { directLine, store } = createDirectLineEmulator();

WebChat.renderWebChat({ directLine, store }, document.getElementById('webchat'));

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity({
from: {
id: 'bot',
role: 'bot'
},
text: 'Hello, World!',
type: 'message'
});

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');

const metaMap = new Map(
Array.from(document.querySelectorAll('meta'))
.filter(element => element.name.startsWith('botframework-webchat'))
.map(element => [element.name, element.getAttribute('content')])
);

expect(metaMap.has('botframework-webchat:api')).toBe(true);
expect(metaMap.get('botframework-webchat:bundle:variant')).toBe('full');
expect(metaMap.has('botframework-webchat:bundle:version')).toBe(true);
expect(metaMap.has('botframework-webchat:bundle')).toBe(true);
expect(metaMap.has('botframework-webchat:component')).toBe(true);
expect(metaMap.has('botframework-webchat:core:version')).toBe(true);
expect(metaMap.has('botframework-webchat:core')).toBe(true);
expect(metaMap.has('botframework-webchat:ui:version')).toBe(true);
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions __tests__/html2/basic/bundle/minimal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-minimal.js"></script>
</head>
<body>
<main id="webchat"></main>
<script>
run(async function () {
const {
testHelpers: { createDirectLineEmulator }
} = window;

const { directLine, store } = createDirectLineEmulator();

WebChat.renderWebChat({ directLine, store }, document.getElementById('webchat'));

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity({
from: {
id: 'bot',
role: 'bot'
},
text: 'Hello, World!',
type: 'message'
});

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');

const metaMap = new Map(
Array.from(document.querySelectorAll('meta'))
.filter(element => element.name.startsWith('botframework-webchat'))
.map(element => [element.name, element.getAttribute('content')])
);

expect(metaMap.has('botframework-webchat:api')).toBe(true);
expect(metaMap.get('botframework-webchat:bundle:variant')).toBe('minimal');
expect(metaMap.has('botframework-webchat:bundle:version')).toBe(true);
expect(metaMap.has('botframework-webchat:bundle')).toBe(true);
expect(metaMap.has('botframework-webchat:component')).toBe(true);
expect(metaMap.has('botframework-webchat:core:version')).toBe(true);
expect(metaMap.has('botframework-webchat:core')).toBe(true);
expect(metaMap.has('botframework-webchat:ui:version')).toBe(true);
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type HTMLContentTransformComposerProps = Readonly<{

const HTMLContentTransformComposer = memo(({ children, middleware }: HTMLContentTransformComposerProps) => {
const transform = useMemo<HTMLContentTransformFunction>(() => {
const enhancers = middleware.map(enhancer => enhancer()).reverse();
const enhancers = (middleware || []).map(enhancer => enhancer()).reverse();

return enhancers.reduce(
(chain: HTMLContentTransformFunction, fn) => fn(chain),
Expand Down
Loading