Merge pull request #1831 from apple502j/stop-ask

Clear ask bubble when stopForTarget
This commit is contained in:
Karishma Chadha 2018-12-26 10:29:23 -05:00 committed by GitHub
commit c5284469d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -143,6 +143,7 @@ class Scratch3SensingBlocks {
));
if (currentlyAsking) {
this.runtime.emit('SAY', stopTarget, 'say', '');
if (this._questionList.length > 0) {
this._askNextQuestion();
} else {

View file

@ -67,7 +67,7 @@ test('ask and stop all dismisses question', t => {
test('ask and stop other scripts dismisses if it is the last question', t => {
const rt = new Runtime();
const s = new Sensing(rt);
const util = {target: {visible: false, sprite: {}}, thread: {}};
const util = {target: {visible: false, sprite: {}, getCustomState: () => ({})}, thread: {}};
const expectedQuestion = 'a question';
@ -94,8 +94,8 @@ test('ask and stop other scripts dismisses if it is the last question', t => {
test('ask and stop other scripts asks next question', t => {
const rt = new Runtime();
const s = new Sensing(rt);
const util = {target: {visible: false, sprite: {}}, thread: {}};
const util2 = {target: {visible: false, sprite: {}}, thread: {}};
const util = {target: {visible: false, sprite: {}, getCustomState: () => ({})}, thread: {}};
const util2 = {target: {visible: false, sprite: {}, getCustomState: () => ({})}, thread: {}};
const expectedQuestion = 'a question';
const nextQuestion = 'a followup';