-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify localization strings for carousel flippers (#4646)
* Change left/right to next/previous * Rename loc string ID and add tests * Fix tests
- Loading branch information
Showing
12 changed files
with
163 additions
and
18 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
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
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
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
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,55 @@ | ||
<!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> | ||
<div id="webchat"></div> | ||
<script> | ||
run(async function () { | ||
WebChat.renderWebChat( | ||
{ | ||
directLine: WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }), | ||
store: testHelpers.createStore() | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
// GIVEN: Show the suggested actions. | ||
await pageObjects.sendMessageViaSendBox('suggested-actions'); | ||
await pageConditions.numActivitiesShown(2); | ||
|
||
// WHEN: The right flipper button is clicked. | ||
document.querySelector('[aria-label="Suggested actions"] [aria-label="right"]').click(); | ||
|
||
// TODO: This will be updated from "left/right" to "next/previous" when the carousel support customizing the aria-label. Commented out for now. | ||
// document.querySelector('[aria-label="Suggested actions"] [aria-label="next"]').click(); | ||
|
||
// THEN: It should scroll to the right. | ||
await pageConditions.became( | ||
'suggested actions scrolled to the right', | ||
() => document.querySelector('.react-film__filmstrip').scrollLeft > 0, | ||
1000 | ||
); | ||
|
||
// WHEN: The left flipper button is clicked. | ||
document.querySelector('[aria-label="Suggested actions"] [aria-label="left"]').click(); | ||
|
||
// TODO: This will be updated from "left/right" to "next/previous" when the carousel support customizing the aria-label. Commented out for now. | ||
// document.querySelector('[aria-label="Suggested actions"] [aria-label="previous"]').click(); | ||
|
||
// THEN: It should scroll back to the origin. | ||
await pageConditions.became( | ||
'suggested actions scrolled back to the origin', | ||
() => document.querySelector('.react-film__filmstrip').scrollLeft === 0, | ||
1000 | ||
); | ||
}); | ||
</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,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('suggested actions', () => { | ||
test('should scroll when flipper buttons are clicked', () => runHTML('suggestedActions.scroll.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,56 @@ | ||
<!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> | ||
<div id="webchat"></div> | ||
<script> | ||
run(async function () { | ||
WebChat.renderWebChat( | ||
{ | ||
dir: 'rtl', | ||
directLine: WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }), | ||
store: testHelpers.createStore() | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
// GIVEN: Show the suggested actions. | ||
await pageObjects.sendMessageViaSendBox('suggested-actions'); | ||
await pageConditions.numActivitiesShown(2); | ||
|
||
// WHEN: The right flipper button is clicked. | ||
document.querySelector('[aria-label="Suggested actions"] [aria-label="left"]').click(); | ||
|
||
// TODO: This will be updated from "left/right" to "next/previous" when the carousel support customizing the aria-label. Commented out for now. | ||
// document.querySelector('[aria-label="Suggested actions"] [aria-label="next"]').click(); | ||
|
||
// THEN: It should scroll to the right. | ||
await pageConditions.became( | ||
'suggested actions scrolled to the left', | ||
() => document.querySelector('.react-film__filmstrip').scrollLeft < 0, | ||
1000 | ||
); | ||
|
||
// WHEN: The left flipper button is clicked. | ||
document.querySelector('[aria-label="Suggested actions"] [aria-label="right"]').click(); | ||
|
||
// TODO: This will be updated from "left/right" to "next/previous" when the carousel support customizing the aria-label. Commented out for now. | ||
// document.querySelector('[aria-label="Suggested actions"] [aria-label="previous"]').click(); | ||
|
||
// THEN: It should scroll back to the origin. | ||
await pageConditions.became( | ||
'suggested actions scrolled back to the origin', | ||
() => document.querySelector('.react-film__filmstrip').scrollLeft === 0, | ||
1000 | ||
); | ||
}); | ||
</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,6 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('In RTL', () => | ||
describe('suggested actions', () => { | ||
test('should scroll when flipper buttons are clicked', () => runHTML('suggestedActions.scroll.rtl.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
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
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
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