Skip to content

Commit

Permalink
Code-review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
StaNov committed Jan 21, 2025
1 parent 2a942b4 commit bc0d326
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class NotificationControllerTest : AuthorizedControllerTest() {
@Test
fun `marks notifications as seen`() {
val testData = NotificationsTestData()
val currentUserNotification1 = testData.generateNotificationWithTask()
val currentUserNotification2 = testData.generateNotificationWithTask()
val currentUserNotification1 = testData.generateNotificationWithTask(101)
val currentUserNotification2 = testData.generateNotificationWithTask(102)
val differentUserNotification =
testData.generateNotificationWithTask().apply {
testData.generateNotificationWithTask(103).apply {
user = testData.root.addUserAccountWithoutOrganization { username = "Different User" }.self
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class TestDataBuilder(fn: (TestDataBuilder.() -> Unit) = {}) {
fun addUserAccountWithoutOrganization(ft: UserAccount.() -> Unit): UserAccountBuilder {
val builder = UserAccountBuilder(this)
data.userAccounts.add(builder)
builder.self.name = "Test User without organization " + System.currentTimeMillis()
ft(builder.self)
return builder
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ package io.tolgee.development.testDataBuilder.data
import io.tolgee.model.Notification

class NotificationsTestData : BaseTestData() {
private var nextTaskId = 100000L

val originatingUser =
root.addUserAccount {
name = "originating user"
username = "originatingUser"
username = "notificationsOriginatingUser"
}

val notification = generateNotificationWithTask()
val notification = generateNotificationWithTask(100)
val task = notification.linkedTask

fun generateNotificationWithTask(taskNumber: Long = nextTaskId++): Notification {
fun generateNotificationWithTask(taskNumber: Long): Notification {
val task =
projectBuilder.addTask {
this.name = "Notification task $taskNumber"
Expand Down

0 comments on commit bc0d326

Please sign in to comment.