Skip to content

Commit

Permalink
spinner to comply with mvp.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
querwurzel committed Nov 13, 2023
1 parent 08aa279 commit b740fae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public boolean isErasable(String remoteAddress) {
final var createdBySameAuthor = Objects.equals(remoteAddress, this.getRemoteAddress());

if (createdBySameAuthor) {
return this.getDateCreated().isAfter(LocalDateTime.now().minusHours(1));
return LocalDateTime.now().minusHours(1).isBefore(this.getDateCreated());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void searchPastes() {
doReturn(Flux.empty()).when(pasteService).findByFullText(anyString());

webClient.get()
.uri("/api/v1/paste/search?term=/{term}", "foobar")
.uri("/api/v1/paste/search?term={term}", "foobar")
.exchange()
.expectStatus().isOk()
.expectHeader().cacheControl(CacheControl.maxAge(60, TimeUnit.SECONDS))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ void newInstanceDefaults() {
assertThat(newPaste.getId()).isNotEmpty();
assertThat(newPaste.getViews()).isZero();
assertThat(newPaste.getLastViewed()).isNull();

assertThat(newPaste.getTitle()).isNull();
assertThat(newPaste.getContent()).isEqualTo("someContent");
assertThat(newPaste.isPermanent()).isTrue();
assertThat(newPaste.isEncrypted()).isFalse();
assertThat(newPaste.isPublic()).isTrue();
assertThat(newPaste.getRemoteAddress()).isNull();
}

@Test
Expand All @@ -65,7 +58,7 @@ void trackPasteViewCount() {
void trackPasteLastViewed() {
var newPaste = Paste.newInstance(null, "someContent", null, false, PasteExposure.PUBLIC, null);
var now = LocalDateTime.now();
var yesterday = LocalDateTime.now().minusDays(1);
var yesterday = now.minusDays(1);

newPaste.trackView(now);
newPaste.trackView(yesterday);
Expand All @@ -87,7 +80,7 @@ private static Stream<Arguments> pastesToErase() {
var oneTimePaste = Paste.newInstance(null, "someContent", null, false, PasteExposure.ONCE, "Alice");

var publicPasteRecentlyCreatedByAlice = Paste.newInstance(null, "someContent", null, false, PasteExposure.PUBLIC, "Alice");
publicPasteRecentlyCreatedByAlice.setDateCreated(LocalDateTime.now().minusMinutes(59));
publicPasteRecentlyCreatedByAlice.setDateCreated(LocalDateTime.now().minusMinutes(60).plusSeconds(1));

var publicPasteCreatedSomeTimeAgoByAlice = Paste.newInstance(null, "someContent", null, false, PasteExposure.PUBLIC, "Alice");
publicPasteCreatedSomeTimeAgoByAlice.setDateCreated(LocalDateTime.now().minusMinutes(60));
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Spinner/spinner.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
height: 80px;
}
.lds-ellipsis div {
background: #000;
background: var(--color-text);
position: absolute;
top: 33px;
width: 13px;
Expand Down

0 comments on commit b740fae

Please sign in to comment.