budget-app/budget-capture/tests/java/CaptureReviewInboxTest.java
Arena Assistant 1988457dd1 feat: add macOS capture panel and Android Makepad review
Reuse shared review and confirmation state. Android tile/setup and volatile OCR handoff route into Makepad; native floating controls remain. Android overlay rendering host is not implemented. Prior isolated checks: macOS ARM64 and Android ARM64 library checks, native Linux build/run and tests; native mobile/macOS runtime validation remains outstanding.
2026-10-28 05:02:41 +00:00

38 lines
1.6 KiB
Java

package org.nigig.budgetshare;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class CaptureReviewInboxTest {
@Before public void reset() { CaptureReviewInbox.discard(); }
@Test public void tileOpenRequestIsConsumedOnce() {
CaptureReviewInbox.requestOpen();
assertTrue(CaptureReviewInbox.takeOpenRequest());
assertFalse(CaptureReviewInbox.takeOpenRequest());
}
@Test public void consumesOnce() {
assertTrue(CaptureReviewInbox.offerAt("Milk R25", 10));
assertEquals("Milk R25", CaptureReviewInbox.takeAt(11));
assertNull(CaptureReviewInbox.takeAt(12));
}
@Test public void cannotOverwritePendingReview() {
assertTrue(CaptureReviewInbox.offerAt("first", 10));
assertFalse(CaptureReviewInbox.offerAt("second", 11));
assertEquals("first", CaptureReviewInbox.takeAt(12));
}
@Test public void expiresWithoutPersisting() {
assertTrue(CaptureReviewInbox.offerAt("private", 10));
assertNull(CaptureReviewInbox.takeAt(10 + CaptureReviewInbox.TTL_NANOS));
}
@Test public void cancelDiscards() {
CaptureReviewInbox.offerAt("private", 10);
CaptureReviewInbox.discard();
assertNull(CaptureReviewInbox.takeAt(11));
}
@Test public void boundsTextAndRejectsNull() {
assertFalse(CaptureReviewInbox.offerAt(null, 1));
assertFalse(CaptureReviewInbox.offerAt(new String(new char[CaptureReviewInbox.MAX_CHARS+1]), 1));
assertTrue(CaptureReviewInbox.offerAt("", 1));
assertEquals("", CaptureReviewInbox.takeAt(2));
}
}