diff --git a/src/test/java/nl/tudelft/tam/controller/JobOfferControllerTest.java b/src/test/java/nl/tudelft/tam/controller/JobOfferControllerTest.java
index e8bebc1a15b7efdb5300b59f65430a9153db5e77..dcde8629eaf6b57302c498fc1d2212c54779158f 100644
--- a/src/test/java/nl/tudelft/tam/controller/JobOfferControllerTest.java
+++ b/src/test/java/nl/tudelft/tam/controller/JobOfferControllerTest.java
@@ -343,6 +343,33 @@ class JobOfferControllerTest {
verify(coordinatorDefaultService).addDefaultsToEditionsWithJobsAndWork(anyList());
}
+ @Test
+ @WithUserDetails("teacher")
+ void getManagerPortalTeacherWithNoEditionsTest() throws Exception {
+ String q = "edi";
+
+ when(personService.getRolesForPerson(anyLong())).thenReturn(List.of());
+ when(editionService.getEditionsWithJobsAndWork(anyList())).thenReturn(List.of());
+ when(editionService.filter(anyList(), anyString())).thenReturn(List.of());
+ when(authService.isStaff()).thenReturn(true);
+ when(courseService.getManagingCourses(any())).thenReturn(List.of());
+ when(cohortService.getAllCohorts()).thenReturn(List.of());
+ doNothing().when(coordinatorDefaultService).addDefaultsToEditionsWithJobsAndWork(anyList());
+
+ mvc.perform(get("/job-offer/manage").param("q", q).with(csrf()))
+ .andExpect(status().isOk())
+ .andExpect(view().name("job_offer/manage"))
+ .andExpect(model().attribute("editions", List.of()))
+ .andExpect(model().attribute("managed", List.of()))
+ .andExpect(model().attribute("cohorts", List.of()));
+
+ verify(editionService).getAllEditionIdsThatPersonIsAMangerOf(anyLong());
+ verify(courseService).getManagingCourses(any());
+ verify(editionService).getEditionsWithJobsAndWork(List.of());
+ verify(editionService).filter(List.of(), q);
+ verify(coordinatorDefaultService).addDefaultsToEditionsWithJobsAndWork(anyList());
+ }
+
@Test
@WithUserDetails("admin")
void getManagerPortalTestWithHidePrev() throws Exception {