Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit dba96f9

Browse files
committed
tests for fix #246
1 parent f481a75 commit dba96f9

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/oauth_prompt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def begin_dialog(self, dialog_context: DialogContext, options: PromptOptio
6363
options.prompt.input_hint = InputHints.accepting_input
6464

6565
if options.retry_prompt and not options.retry_prompt.input_hint:
66-
options.prompt.input_hint = InputHints.accepting_input
66+
options.retry_prompt.input_hint = InputHints.accepting_input
6767

6868
# Initialize prompt state
6969
timeout = self._settings.timeout if isinstance(self._settings.timeout, int) else 900000

libraries/botbuilder-dialogs/tests/test_oauth_prompt.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,40 @@ def inspector(activity: Activity, description: str = None):
176176

177177
step1 = await adapter.send(magic_code)
178178
await step1.assert_reply(inspector)
179+
180+
async def test_should_add_accepting_input_hint_oauth_prompt(self):
181+
connection_name = "myConnection"
182+
called = False
183+
184+
async def callback_handler(turn_context: TurnContext):
185+
nonlocal called
186+
dc = await dialogs.create_context(turn_context)
187+
188+
await dc.continue_dialog()
189+
await dc.prompt('prompt', PromptOptions(prompt=Activity(), retry_prompt=Activity()))
190+
191+
self.assertTrue(dc.active_dialog.state['options'].prompt.input_hint == InputHints.accepting_input)
192+
self.assertTrue(dc.active_dialog.state['options'].retry_prompt.input_hint == InputHints.accepting_input)
193+
194+
await convo_state.save_changes(turn_context)
195+
called = True
196+
197+
# Initialize TestAdapter.
198+
adapter = TestAdapter(callback_handler)
199+
200+
# Create ConversationState with MemoryStorage and register the state as middleware.
201+
convo_state = ConversationState(MemoryStorage())
202+
203+
# Create a DialogState property, DialogSet and AttachmentPrompt.
204+
dialog_state = convo_state.create_property('dialogState')
205+
dialogs = DialogSet(dialog_state)
206+
dialogs.add(OAuthPrompt('prompt', OAuthPromptSettings(
207+
connection_name,
208+
'Login',
209+
None,
210+
300000
211+
)))
212+
213+
await adapter.send('Hello')
214+
self.assertTrue(called)
215+

0 commit comments

Comments
 (0)