Skip to content

Commit

Permalink
Add a test for Azure sources (dependabot#8629)
Browse files Browse the repository at this point in the history
* Azure DevOps now supports HTML in PR descriptions

While researching dependabot#6287 (comment),
I noticed that https://developercommunity.visualstudio.com/content/problem/608769/add-support-for-in-markdown.html
eventually leads to https://developercommunity.visualstudio.com/t/add-support-for-the-html-tag-in-markdown/609415#T-N1190213
which says that Azure ADO now supports the `<details>` tag in Markdown.

Furthermore, I suspect that ADO now fully supports HTML in PR
descriptions but it's not documented either way in https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/create?view=azure-devops-rest-7.0&tabs=HTTP#request-body.

So opening this PR as the simple solution. If ADO doesn't support HTML
but does support the `<details>` tag, then we'll unfortunately need a
more complex solution of refactoring things... but I hope not.

Fix dependabot#6453

* Add a test on azure sources

---------

Co-authored-by: Barry Gordon <brrygrdn@github.com>
  • Loading branch information
jeffwidman and brrygrdn authored Dec 19, 2023
1 parent ecb3cb6 commit 13df253
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@
it "removes all content after the 50th line" do
expect(presenter.to_s).not_to include("## 1.0.0 - June 11, 2014")
end

context "with an azure source" do
let(:source) { Dependabot::Source.new(provider: "azure", repo: "gc/bp") }

it "adds a truncation notice" do
expect(presenter.to_s).to include("(truncated)")
end

it "does not include a closing table fragment" do
expect(presenter.to_s).not_to include("></tr></table>")
end

it "removes all content after the 50th line" do
expect(presenter.to_s).not_to include("## 1.0.0 - June 11, 2014")
end
end
end
end
end

0 comments on commit 13df253

Please sign in to comment.