-
Notifications
You must be signed in to change notification settings - Fork 370
Enhances 'teams chat message send' with contentType #7086
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the teams chat message send command by adding support for specifying the content type of chat messages. Users can now send messages as either plain text or HTML formatted content.
- Adds a new optional
--contentTypeparameter accepting 'text' or 'html' values - Updates telemetry tracking to include the contentType option
- Refactors test setup to eliminate duplicate stub configurations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/m365/teams/commands/chat/chat-message-send.ts | Adds contentType option with validation, imports Auth class, modifies API request to include contentType in body, and updates access token retrieval |
| src/m365/teams/commands/chat/chat-message-send.spec.ts | Consolidates test setup by moving prompt setting stub to before hook, adds validation test for invalid contentType, adds test for HTML content type functionality |
| src/m365/teams/commands/chat/chatUtil.ts | Fixes spacing in comment documentation (emailaddresses → email addresses) |
| docs/docs/cmd/teams/chat/chat-message-send.mdx | Adds contentType option documentation, includes permissions table with delegated and application permission details, updates example to demonstrate HTML content type usage |
d15a18a to
635b3df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/m365/teams/commands/chat/chat-message-send.spec.ts:245
- The validation test for invalid contentType values is present, but there's no corresponding test to verify that valid contentType values ('text' and 'html') pass validation. Consider adding a test case similar to the existing validation tests that verifies contentType validation succeeds with valid values.
it('fails validation if contentType is not valid', async () => {
const actual = await command.validate({
options: {
chatId: '19:8b081ef6-4792-4def-b2c9-c363a1bf41d5_5031bb31-22c0-4f6f-9f73-91d34ab2b32d@unq.gbl.spaces',
contentType: 'Invalid',
message: 'Hello World'
}
}, commandInfo);
assert.notStrictEqual(actual, true);
});
635b3df to
e07209e
Compare
Closes #6483