Skip to content

Commit

Permalink
Test for notification triggering while creating a task
Browse files Browse the repository at this point in the history
  • Loading branch information
StaNov committed Jan 13, 2025
1 parent 01ac773 commit 441090f
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class TaskControllerTest : ProjectAuthControllerTest("/v2/projects/") {

@Test
@ProjectJWTAuthTestMethod
fun `creates new task`() {
fun `creates new task which triggers notification`() {
val keys = testData.keysOutOfTask.map { it.self.id }.toMutableSet()
performProjectAuthPost(
"tasks",
Expand All @@ -66,21 +66,25 @@ class TaskControllerTest : ProjectAuthControllerTest("/v2/projects/") {
languageId = testData.englishLanguage.id,
assignees =
mutableSetOf(
testData.orgMember.self.id,
testData.user.id,
),
keys = keys,
),
).andAssertThatJson {
node("number").isNumber
node("name").isEqualTo("Another task")
node("assignees[0].name").isEqualTo(testData.orgMember.self.name)
node("assignees[0].name").isEqualTo(testData.user.name)
node("language.tag").isEqualTo(testData.englishLanguage.tag)
node("totalItems").isEqualTo(keys.size)
}

performProjectAuthGet("tasks").andAssertThatJson {
node("page.totalElements").isNumber.isEqualTo(BigDecimal(3))
}

performAuthGet("/v2/notifications").andAssertThatJson {
node("_embedded.notificationModelList[0].linkedTask.name").isEqualTo("Another task")
}
}

@Test
Expand Down

0 comments on commit 441090f

Please sign in to comment.