Skip to content
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

fix(plugin/microsoft-teams): incorrect markdown rendering #2080

Merged
merged 1 commit into from Nov 22, 2021

Conversation

mathieubergeron
Copy link
Contributor

@mathieubergeron mathieubergeron commented Sep 21, 2021

What Changed

Changes in this PR are related to the microsoft-teams plugin, and the following issue: #2020.

I removed the part that escaped characters using the jsesc library.

Note that I also removed some of the unit tests, which was either duplicated or not useful. I will leave comments about those in the PR.

Why

It seems that we don't know why jsesc was used in the first place, but it is breaking the markdown rendering.

Before:
image

After:
image

Todo:

  • Add tests
  • Add docs

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major

expect(fetchSpy.mock.calls[0][1].body).toMatchSnapshot();
});

test("should add more indents to nested lists", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I removed this test because the code, both before and after my changes, did (/does) not add more indents to nested lists.

I think this might have been originaly copy/pasted from the slack plugin tests.

expect(fetchSpy.mock.calls[0][1].body).toMatchSnapshot();
});

test("should add more indents to nested lists - 2 spaces", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -276,28 +236,13 @@ describe("createPost", () => {
expect(fetchSpy.mock.calls[0][1].body).toMatchSnapshot();
});

test("should remove markdown code types from block", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger: dummyLog(),
} as any;

describe("postToMicrosoftTeams", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to me like those 2 tests are identical to the ones in index.test.ts:

  • "should call Microsoft Office Teams api with minimal config"
  • "should call Microsoft Office Teams api through http proxy"

@mathieubergeron
Copy link
Contributor Author

ping @reintroducing @vincentbriglia @hipstersmoothie

Let me know is you see anything wrong, thank you!! :)

@adierkens adierkens added the patch Increment the patch version when merged label Sep 21, 2021
@codecov
Copy link

codecov bot commented Sep 21, 2021

Codecov Report

Merging #2080 (40446bc) into main (9f1a57d) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2080      +/-   ##
==========================================
- Coverage   80.19%   80.18%   -0.01%     
==========================================
  Files          66       66              
  Lines        5403     5401       -2     
  Branches     1254     1254              
==========================================
- Hits         4333     4331       -2     
  Misses        709      709              
  Partials      361      361              
Impacted Files Coverage Δ
plugins/microsoft-teams/src/index.ts 85.45% <ø> (-0.52%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d79865f...40446bc. Read the comment docs.

Copy link

@jakobe jakobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mathieubergeron
Copy link
Contributor Author

@jakobe Thanks! Is the coverage check (codecov/project) blocking this PR from getting merged?

@mathieubergeron
Copy link
Contributor Author

ping @jakobe

Can we get this merged? Thanks!

@jakobe
Copy link

jakobe commented Nov 11, 2021

ping @jakobe

Can we get this merged? Thanks!

Hey @mathieubergeron sorry for the waaaaay late reply, I have a mail filter setup for Github mails otherwise I just drown 😅 , so haven't paid attention to this 🙈

I'm not the maintainer of this project, just chimed in with my findings and a PR approval to state that it looks good IMHO 👍🏻

ping @hipstersmoothie 😄

@jakobe
Copy link

jakobe commented Nov 22, 2021

ping @jakobe
Can we get this merged? Thanks!

Hey @mathieubergeron sorry for the waaaaay late reply, I have a mail filter setup for Github mails otherwise I just drown 😅 , so haven't paid attention to this 🙈

I'm not the maintainer of this project, just chimed in with my findings and a PR approval to state that it looks good IMHO 👍🏻

ping @hipstersmoothie 😄

@hipstersmoothie Any plans for merging this? 🙏🏻

@hipstersmoothie hipstersmoothie merged commit af5165e into intuit:main Nov 22, 2021
@adierkens
Copy link
Collaborator

🚀 PR was released in v10.32.3 🚀

@adierkens adierkens added the released This issue/pull request has been released. label Nov 22, 2021
@jakobe
Copy link

jakobe commented Nov 22, 2021

Thx @hipstersmoothie 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants