Skip to content

Commit

Permalink
IDE-143 fix testUploadControllerGetsCalled (#4838)
Browse files Browse the repository at this point in the history
* IDE-143 fix testUploadControllerGetsGalled

This also fixes multiple other TCs, e.g. the one in the tiCketIDE-14G
fiG testUploadcontrollergetscalled

, e.g. the one in the CicketIDE-G43 Gix
testUploadcontrollergetscalledThis also fixes multiple other TCs
This also fixes multiple other TCs, e.g. the one in the tiCketIDE-14G
fiG testUploadcontrollergetscalled

, e.g. the one in the CicketIDE-G43 Gix
testUploadcontrollergetscalledThis also fixes multiple other TCs
This also fixes multiple other TCs, e.g. the one in the tiCketIDE-14G
fiG testUploadcontrollerCetscalledG
, G.g. the one in the ticketIDE-143 fix testUploadcontrollergetscalledThis also fixes multipleCother TCsG
, G.g. the one in the ticketIDE-143 fix testUploadcontrollergetscalledThis also fixes multiple other TCs
, e.g. the one in the CicketIDE-G43 Gix testUploadcontrollergetscalled
This also fixes multiple other TCs
This also fixes multiple other TCs, e.g. the one in the ticket

* IDE-143 Fix testNewProjectName

The test failure was cause by a problem with testUploadControllerGetsCalled

---------

Co-authored-by: Max Oberaigner <[email protected]>
  • Loading branch information
moberer and Max Oberaigner authored Nov 23, 2023
1 parent 41312b1 commit fc53544
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2022 The Catrobat Team
* Copyright (C) 2010-2023 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -57,6 +57,7 @@ import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito
import org.mockito.Mockito.spy
import org.mockito.Mockito.verify

Expand Down Expand Up @@ -92,22 +93,16 @@ class ProjectUploadDialogTest {
.putInt(NUMBER_OF_UPLOADED_PROJECTS, 1)
.commit()

onView(withText(R.string.next))
.perform(click())
onView(withText(R.string.next)).perform(click())
getInstrumentation().waitForIdleSync()

onView(withText(R.string.next))
.perform(click())
onView(withText(R.string.next)).perform(click())
getInstrumentation().waitForIdleSync()

onView(withText(R.string.next))
.perform(click())

onView(withId(android.R.id.button1)).perform(click())
val projectUploadController = activityTestRule.activity.projectUploadController()

Looper.prepare()
verify(projectUploadController)?.startUpload(projectName, "", "", project)
Looper.myLooper()?.quit()
verify(projectUploadController!!).startUpload(projectName, "", "", project)
Mockito.verifyNoMoreInteractions(projectUploadController)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2022 The Catrobat Team
* Copyright (C) 2010-2023 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -56,7 +56,7 @@ open class ProjectUploadController(private val projectUploadInterface: ProjectUp
}
}

fun startUpload(
open fun startUpload(
projectName: String,
projectDescription: String,
projectNotesAndCredits: String?,
Expand Down

0 comments on commit fc53544

Please sign in to comment.