Skip to content

Commit

Permalink
Bump to 4.14.1 for release (#4045)
Browse files Browse the repository at this point in the history
* 4.14.1

* Improves test reliability
  • Loading branch information
compulim authored Sep 7, 2021
1 parent 99625f4 commit 1b842df
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 26 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [4.14.1] - 2021-09-07

### Fixed

- Fixes [#3968](https://github.com/microsoft/BotFramework-WebChat/issues/3968). Fix typing for `usePerformCardAction` hook, by [@compulim](https://github.com/compulim), in PR [#3969](https://github.com/microsoft/BotFramework-WebChat/pull/3969)
Expand Down
33 changes: 24 additions & 9 deletions __tests__/inputHint.consecutive.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,54 +54,69 @@ describe('input hint from consecutive messages', () => {
test('should turn on microphone for accepting then accepting', async () => {
await sendInputHintCommand('accepting', 'accepting');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});

test('should turn on microphone for accepting then expecting', async () => {
await sendInputHintCommand('accepting', 'expecting');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeTruthy();
await driver.wait(speechRecognitionStartCalled(), timeouts.ui);
});

test('should turn on microphone for accepting then ignoring', async () => {
await sendInputHintCommand('accepting', 'ignoring');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});

test('should turn on microphone for expecting then accepting', async () => {
await sendInputHintCommand('expecting', 'accepting');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeTruthy();
await driver.wait(speechRecognitionStartCalled(), timeouts.ui);
});

test('should turn on microphone for expecting then expecting', async () => {
await sendInputHintCommand('expecting', 'expecting');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeTruthy();
await driver.wait(speechRecognitionStartCalled(), timeouts.ui);
});

test('should turn on microphone for expecting then ignoring', async () => {
await sendInputHintCommand('expecting', 'ignoring');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});

test('should turn on microphone for ignoring then accepting', async () => {
await sendInputHintCommand('ignoring', 'accepting');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});

test('should turn on microphone for ignoring then expecting', async () => {
await sendInputHintCommand('ignoring', 'expecting');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeTruthy();
await driver.wait(speechRecognitionStartCalled(), timeouts.ui);
});

test('should turn on microphone for ignoring then ignoring', async () => {
await sendInputHintCommand('ignoring', 'ignoring');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});
});
40 changes: 32 additions & 8 deletions __tests__/inputHint.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ describe('input hint', () => {
await pageObjects.startSpeechSynthesize();
await pageObjects.endSpeechSynthesize();

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeTruthy();
// After synthesis completed, we will dispatch START_DICTATE action.
// The action will trigger a re-render and the useEffect() will kickoff speech recognition.
// There could be a slight time delay between "end of synthesis" and "kickoff recognition".
await driver.wait(speechRecognitionStartCalled(), timeouts.ui);
});

test('should not turn on microphone if initiated via typing', async () => {
Expand All @@ -45,7 +48,10 @@ describe('input hint', () => {

await driver.wait(minNumActivitiesShown(2), timeouts.directLine);

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});
});

Expand All @@ -67,7 +73,10 @@ describe('input hint', () => {
await pageObjects.startSpeechSynthesize();
await pageObjects.endSpeechSynthesize();

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});

test('should not turn on microphone if initiated via typing', async () => {
Expand All @@ -83,7 +92,10 @@ describe('input hint', () => {

await driver.wait(minNumActivitiesShown(2), timeouts.directLine);

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});
});

Expand All @@ -105,7 +117,10 @@ describe('input hint', () => {
await pageObjects.startSpeechSynthesize();
await pageObjects.endSpeechSynthesize();

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});

test('should turn off microphone if initiated via typing', async () => {
Expand All @@ -121,7 +136,10 @@ describe('input hint', () => {

await driver.wait(minNumActivitiesShown(2), timeouts.directLine);

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});
});

Expand All @@ -143,7 +161,10 @@ describe('input hint', () => {
await pageObjects.startSpeechSynthesize();
await pageObjects.endSpeechSynthesize();

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});

test('should not turn on microphone if initiated via typing', async () => {
Expand All @@ -159,7 +180,10 @@ describe('input hint', () => {

await driver.wait(minNumActivitiesShown(2), timeouts.directLine);

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
});
});
});
2 changes: 1 addition & 1 deletion __tests__/speech.recognition.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,6 @@ describe('speech recognition', () => {

await pageObjects.clickMicrophoneButton();

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toHaveProperty('lang', 'zh-HK');
await expect(driver.wait(speechRecognitionStartCalled(), timeouts.ui)).resolves.toHaveProperty('lang', 'zh-HK');
});
});
21 changes: 15 additions & 6 deletions __tests__/speech.synthesis.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,17 @@ describe('speech synthesis', () => {

await pageObjects.sendMessageViaMicrophone('hint expecting');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
await driver.wait(minNumActivitiesShown(2), timeouts.directLine);
await driver.wait(speechSynthesisUtterancePended(), timeouts.ui);

await pageObjects.startSpeechSynthesize();
await pageObjects.errorSpeechSynthesize();

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeTruthy();
await driver.wait(speechRecognitionStartCalled(), timeouts.ui);
});

test('should not synthesis if engine is explicitly configured off', async () => {
Expand All @@ -94,7 +97,10 @@ describe('speech synthesis', () => {

await pageObjects.sendMessageViaMicrophone('Hello, World!');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
await driver.wait(minNumActivitiesShown(2), timeouts.directLine);

expect(await pageObjects.getConsoleErrors()).toEqual([]);
Expand All @@ -109,7 +115,10 @@ describe('speech synthesis', () => {

await pageObjects.sendMessageViaMicrophone('echo Hello, World!');

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeFalsy();
// TODO: [P3] #4046 Improves test reliability by identifying false positives and reduce wait time.
await expect(() => driver.wait(speechRecognitionStartCalled(), timeouts.ui)).rejects.toThrow(
'Waiting SpeechRecognition.start to be called'
);
await driver.wait(minNumActivitiesShown(3), timeouts.directLine);

await expect(pageObjects.startSpeechSynthesize()).resolves.toHaveProperty(
Expand All @@ -121,7 +130,7 @@ describe('speech synthesis', () => {

await pageObjects.clickMicrophoneButton();

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeTruthy();
await driver.wait(speechRecognitionStartCalled(), timeouts.ui);
await driver.wait(negationOf(speechSynthesisUtterancePended()), timeouts.ui);
});

Expand All @@ -144,7 +153,7 @@ describe('speech synthesis', () => {

await driver.wait(minNumActivitiesShown(2), timeouts.directLine);

await expect(speechRecognitionStartCalled().fn(driver)).resolves.toBeTruthy();
await driver.wait(speechRecognitionStartCalled(), timeouts.ui);
await driver.wait(negationOf(speechSynthesisUtterancePended()), timeouts.ui);
});
});
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "botframework-webchat-root",
"version": "4.14.1-0",
"version": "4.14.1",
"private": true,
"files": [
"lib/**/*"
Expand Down

0 comments on commit 1b842df

Please sign in to comment.