-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Allow feedback form to be submitted without feedback text #5493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
OEvgeny
merged 14 commits into
microsoft:main
from
lexi-taylor:users/lexitayor/feedbackform/no-message/bug
Jun 13, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e48e3be
allow feedback form to be submitted without text
lexi-taylor bb95af5
Update packages/component/src/ActivityFeedback/providers/ActivityFeed…
lexi-taylor a1f7612
update changelog
lexi-taylor dd2e00c
Merge branch 'main' into users/lexitayor/feedbackform/no-message/bug
OEvgeny ee24ba4
Merge branch 'main' into users/lexitayor/feedbackform/no-message/bug
lexi-taylor 7ae503b
Fix test
compulim b61887c
Use isActionRequireReview
compulim ae6ceaf
Add tests
compulim 5375388
Comments
compulim bb81117
Removed tests
compulim 041bab0
Update snapshots
compulim 40df488
Remove new line
compulim a22e366
Add deprecation notes
compulim fae09e8
Merge branch 'main' into users/lexitayor/feedbackform/no-message/bug
OEvgeny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Binary file modified
BIN
-1 Byte
(100%)
__tests__/html2/feedbackForm/feedback.form.activity.html.snap-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
__tests__/html2/feedbackForm/feedback.form.activity.html.snap-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions
102
__tests__/html2/feedbackForm/feedback.form.emptyFeedback.html
This file contains hidden or 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,102 @@ | ||
| <!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 type="module"> | ||
| run(async function () { | ||
| const { | ||
| WebChat: { renderWebChat, testIds } | ||
| } = window; // Imports in UMD fashion. | ||
|
|
||
| const { directLine, store } = testHelpers.createDirectLineEmulator(); | ||
|
|
||
| renderWebChat( | ||
| { | ||
| directLine, | ||
| store, | ||
| styleOptions: { feedbackActionsPlacement: 'activity-actions' } | ||
| }, | ||
| document.getElementById('webchat') | ||
| ); | ||
|
|
||
| await pageConditions.uiConnected(); | ||
| pageElements.byTestId(testIds.sendBoxTextBox).focus(); | ||
|
|
||
| // GIVEN: An activity with feedback form. | ||
| await directLine.emulateIncomingActivity({ | ||
| type: 'message', | ||
| id: 'a-00000', | ||
| timestamp: 0, | ||
| text: 'This is a test message to show feedback buttons', | ||
| from: { | ||
| role: 'bot' | ||
| }, | ||
| locale: 'en-US', | ||
| entities: [], | ||
| channelData: { | ||
| feedbackLoop: { | ||
| type: 'default', | ||
| disclaimer: 'This is a test disclaimer message' | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| await pageConditions.numActivitiesShown(1); | ||
|
|
||
| // WHEN: Focus on the like button. | ||
| await host.sendShiftTab(3); | ||
| await host.sendKeys('ENTER', 'SPACE'); | ||
|
|
||
| // THEN: The feedback form should be expanded. | ||
| await pageConditions.became( | ||
| 'feedback form is open', | ||
| () => document.activeElement === pageElements.byTestId(testIds.feedbackSendBox), | ||
| 1000 | ||
| ); | ||
|
|
||
| // WHEN: An empty feedback is being submitted. | ||
| const { activity } = await directLine.actPostActivity(async () => { | ||
| await host.sendTab(1); | ||
| await host.sendKeys('ENTER'); | ||
| }); | ||
|
|
||
| // THEN: Should post a "message/submitAction". | ||
| expect(activity).toEqual( | ||
| expect.objectContaining({ | ||
| type: 'invoke', | ||
| name: 'message/submitAction', | ||
| value: { | ||
| actionName: 'feedback', | ||
| actionValue: { | ||
| reaction: 'like', | ||
| feedback: { | ||
| feedbackText: '' | ||
| } | ||
| } | ||
| } | ||
| }) | ||
| ); | ||
|
|
||
| // THEN: Feedback form should be collapsed. | ||
| await expect(pageElements.byTestId(testIds.feedbackSendBox)).toBeFalsy(); | ||
|
|
||
| // THEN: All feedback buttons should be grayed out. | ||
| await expect( | ||
| Array.from(pageElements.allByTestId(testIds.feedbackButton)).every( | ||
| buttonElement => buttonElement.getAttribute('aria-disabled') === 'true' | ||
| ) | ||
| ).toBe(true); | ||
|
|
||
| // THEN: Should match snapshot. | ||
| await host.snapshot('local'); | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> |
Binary file added
BIN
+13.2 KB
__tests__/html2/feedbackForm/feedback.form.emptyFeedback.html.snap-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.