-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename ClockView to HomeView and update package references
Deleted package-info.java file from services package. Renamed ClockView.java to HomeView.java and adjusted all relevant references in tests and run configurations. These changes ensure proper routing and functionality within the updated package structure.
- Loading branch information
1 parent
3f2545e
commit f15fa42
Showing
8 changed files
with
52 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
src/test/java/dev/nathanlively/views/clock/ClockMvcTest.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/test/java/dev/nathanlively/views/clock/HomeViewTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package dev.nathanlively.views.clock; | ||
|
||
import com.vaadin.flow.component.UI; | ||
import dev.nathanlively.HomeView; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static com.github.mvysny.kaributesting.v10.LocatorJ._get; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@Tag("ui") | ||
class HomeViewTest extends KaribuTest { | ||
|
||
private HomeView view; | ||
|
||
@BeforeEach | ||
public void login() { | ||
UI.getCurrent().navigate(HomeView.class); | ||
view = _get(HomeView.class); | ||
} | ||
|
||
@Test | ||
public void getRequestToIndex_returnsView() { | ||
assertThat(view).isNotNull(); | ||
} | ||
|
||
@Test | ||
void viewIndex_returnsListOfClockEventViews() { | ||
// Arrange: Mock the ClockEventService to return a list of ClockEvent views | ||
// List<ClockEvent> mockEvents = List.of( | ||
// new ClockEvent(LocalDateTime.now(), ClockEventType.IN), | ||
// new ClockEvent(LocalDateTime.now(), ClockEventType.OUT) | ||
// ); | ||
|
||
// Act: Initialize the View and check if the list is injected correctly. | ||
// HomeView homeView = new HomeView(clockEventService); | ||
// UnorderedList eventsList = homeView.getContent().getComponentAt(0, UnorderedList.class); | ||
|
||
// Assert: Check if the list contains the expected items | ||
// assertThat(eventsList.getComponentCount()).isEqualTo(mockEvents.size()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters