Skip to content

Commit 5e44a41

Browse files
committed
chore: include two test cases
1 parent 97d33af commit 5e44a41

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

modules/core/src/test/scala/org/scalasteward/core/forge/data/NewPullRequestDataTest.scala

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,4 +737,113 @@ class NewPullRequestDataTest extends FunSuite {
737737

738738
assertEquals(obtained, expected)
739739
}
740+
741+
test("should show major upgrade warning sign") {
742+
val update = ("org.typelevel".g % "cats-effect".a % "2.5.5" %> "3.4.2").single
743+
744+
val body = bodyFor(
745+
update = update,
746+
edits = List.empty,
747+
artifactIdToUrl = Map.empty,
748+
artifactIdToUpdateInfoUrls = Map.empty,
749+
filesWithOldVersion = List.empty,
750+
configParsingError = None,
751+
labels = List(
752+
"library-update",
753+
"early-semver-major",
754+
"semver-spec-minor",
755+
"commit-count:1"
756+
)
757+
)
758+
val expected =
759+
s"""|## About this PR
760+
|📦 Updates org.typelevel:cats-effect from 2.5.5 to 3.4.2 ⚠
761+
|
762+
|## Usage
763+
|✅ **Please merge!**
764+
|
765+
|I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
766+
|
767+
|If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
768+
|
769+
|Configure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/${org.scalasteward.core.BuildInfo.gitHeadCommit}/docs/repo-specific-configuration.md) file.
770+
|
771+
|_Have a fantastic day writing Scala!_
772+
|
773+
|<details>
774+
|<summary>⚙ Adjust future updates</summary>
775+
|
776+
|Add this to your `.scala-steward.conf` file to ignore future updates of this dependency:
777+
|```
778+
|updates.ignore = [ { groupId = "org.typelevel", artifactId = "cats-effect" } ]
779+
|```
780+
|Or, add this to slow down future updates of this dependency:
781+
|```
782+
|dependencyOverrides = [{
783+
| pullRequests = { frequency = "30 days" },
784+
| dependency = { groupId = "org.typelevel", artifactId = "cats-effect" }
785+
|}]
786+
|```
787+
|</details>
788+
|
789+
|<sup>
790+
|labels: library-update, early-semver-major, semver-spec-minor, commit-count:1
791+
|</sup>""".stripMargin
792+
793+
assertEquals(body, expected)
794+
}
795+
test("should not show major upgrade warning sign on a minor update") {
796+
val update = ("com.lihaoyi".g % "os-lib".a % "0.7.8" %> "0.9.1").single
797+
798+
val body = bodyFor(
799+
update = update,
800+
edits = List.empty,
801+
artifactIdToUrl = Map.empty,
802+
artifactIdToUpdateInfoUrls = Map.empty,
803+
filesWithOldVersion = List.empty,
804+
configParsingError = None,
805+
labels = List(
806+
"library-update",
807+
"early-semver-major",
808+
"semver-spec-minor",
809+
"commit-count:1"
810+
)
811+
)
812+
val expected =
813+
s"""|## About this PR
814+
|📦 Updates com.lihaoyi:os-lib from 0.7.8 to 0.9.1
815+
|
816+
|## Usage
817+
|✅ **Please merge!**
818+
|
819+
|I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
820+
|
821+
|If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
822+
|
823+
|Configure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/${org.scalasteward.core.BuildInfo.gitHeadCommit}/docs/repo-specific-configuration.md) file.
824+
|
825+
|_Have a fantastic day writing Scala!_
826+
|
827+
|<details>
828+
|<summary>⚙ Adjust future updates</summary>
829+
|
830+
|Add this to your `.scala-steward.conf` file to ignore future updates of this dependency:
831+
|```
832+
|updates.ignore = [ { groupId = "com.lihaoyi", artifactId = "os-lib" } ]
833+
|```
834+
|Or, add this to slow down future updates of this dependency:
835+
|```
836+
|dependencyOverrides = [{
837+
| pullRequests = { frequency = "30 days" },
838+
| dependency = { groupId = "com.lihaoyi", artifactId = "os-lib" }
839+
|}]
840+
|```
841+
|</details>
842+
|
843+
|<sup>
844+
|labels: library-update, early-semver-major, semver-spec-minor, commit-count:1
845+
|</sup>""".stripMargin
846+
847+
assertEquals(body, expected)
848+
}
740849
}

0 commit comments

Comments
 (0)