97: Update test code for TempaltePanel
This commit is contained in:
parent
4c5e6ab961
commit
b990b65b20
@ -18,54 +18,56 @@ public class TemplatePanelTest extends SciProTest {
|
||||
public static final ProjectType BACHELOR = new ProjectType(DegreeType.BACHELOR, "Bachelor", "Bachelor");
|
||||
public static final ProjectType MASTER = new ProjectType(DegreeType.MASTER, "Master", "Master");
|
||||
public static final ProjectType MAGISTER = new ProjectType(DegreeType.MAGISTER, "Magister", "Magister");
|
||||
|
||||
private static final String key = "between2017_202410";
|
||||
private TemplatePanel panel;
|
||||
|
||||
@Test
|
||||
public void bachelor_container_visible_if_bachelor_project() {
|
||||
startPanel(BACHELOR, 15);
|
||||
tester.assertVisible(path(panel, "from2017", BACHELOR_CONTAINER));
|
||||
tester.assertVisible(path(panel, key, BACHELOR_CONTAINER));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bachelor_container_invisible_if_not_bachelor_project() {
|
||||
startPanel(MASTER, 15);
|
||||
tester.assertInvisible(path(panel, "from2017", BACHELOR_CONTAINER));
|
||||
tester.assertInvisible(path(panel, key, BACHELOR_CONTAINER));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void magister_container_visible_if_magister_project() {
|
||||
startPanel(MAGISTER, 15);
|
||||
tester.assertVisible(path(panel, "from2017", MASTER_15_CONTAINER));
|
||||
tester.assertVisible(path(panel, key, MASTER_15_CONTAINER));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void magister_container_invisible_if_not_magister() {
|
||||
startPanel(BACHELOR, 15);
|
||||
tester.assertInvisible(path(panel, "from2017", MASTER_15_CONTAINER));
|
||||
tester.assertInvisible(path(panel, key, MASTER_15_CONTAINER));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void magister_container_invisible_if_wrong_credits() {
|
||||
startPanel(MASTER, 30);
|
||||
tester.assertInvisible(path(panel, "from2017", MASTER_15_CONTAINER));
|
||||
tester.assertInvisible(path(panel, key, MASTER_15_CONTAINER));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void master_30_container_visible_if_master_30_project() {
|
||||
startPanel(MASTER, 30);
|
||||
tester.assertVisible(path(panel, "from2017", MASTER_30_CONTAINER));
|
||||
tester.assertVisible(path(panel, key, MASTER_30_CONTAINER));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void master_30_container_invisible_if_not_master() {
|
||||
startPanel(BACHELOR, 30);
|
||||
tester.assertInvisible(path(panel, "from2017", MASTER_30_CONTAINER));
|
||||
tester.assertInvisible(path(panel, key, MASTER_30_CONTAINER));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void master_30_container_visible_if_master_and_0_credits() {
|
||||
startPanel(MASTER, 0);
|
||||
tester.assertVisible(path(panel, "from2017", MASTER_30_CONTAINER));
|
||||
tester.assertVisible(path(panel, key, MASTER_30_CONTAINER));
|
||||
}
|
||||
|
||||
private void startPanel(ProjectType projectType, int credits) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user