Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions scripts/verify-extension-ui.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ async function collectPopupState(popup) {
};
};
const button = document.getElementById("scanBtn");
const scanSection = document.getElementById("scanSection");
const toast = document.getElementById("toast");
const customSection = document.getElementById("customContextSection");
const customInput = document.getElementById("customInput");
Expand Down Expand Up @@ -355,14 +354,6 @@ async function collectPopupState(popup) {
rect: rectOf(button),
}
: null,
scanSection: scanSection
? {
title: scanSection.title,
className: scanSection.className,
rect: rectOf(scanSection),
hidden: scanSection.classList.contains("hidden"),
}
: null,
toast: toast
? {
className: toast.className,
Expand Down Expand Up @@ -390,7 +381,7 @@ async function collectPopupState(popup) {
maxHeight: getComputedStyle(results).maxHeight,
},
eventCards: document.querySelectorAll(".event-card").length,
skeletonCards: document.querySelectorAll(".skeleton-card").length,
skeletonCards: document.querySelectorAll(".skeleton-row").length,
upcomingCards: document.querySelectorAll("#upcomingEventsList .event-card").length,
pastCards: document.querySelectorAll("#pastEventsList .event-card").length,
selectedCards: document.querySelectorAll(".event-card.selected").length,
Expand Down Expand Up @@ -603,7 +594,7 @@ async function main() {
const before = await captureEvidence(popup, reportDir, "protected-page-before");
assert.equal(before.state.scanButton.disabled, true);
assert.equal(before.state.scanButton.title, "Chrome pages cannot be scanned.");
assert.match(before.state.scanSection.className, /\bscan-unavailable\b/);
assert.match(before.state.scanButton.className, /\bscan-unavailable\b/);
assert.equal(before.state.toast.hidden, true);
assert.equal(before.state.results.eventCards, 0);

Expand Down Expand Up @@ -637,8 +628,7 @@ async function main() {
const evidence = await captureEvidence(popup, reportDir, "regular-page-ready");

assert.equal(evidence.state.scanButton.disabled, false);
assert.equal(evidence.state.scanButton.title, "Scan Page");
assert.equal(evidence.state.scanSection.title, "");
assert.equal(evidence.state.scanButton.title, "Scan this page");
assert.equal(evidence.state.toast.hidden, true);
assertNoPopupOverflow(evidence.state);
assertNoUnexpectedErrors(diagnostics);
Expand All @@ -660,7 +650,7 @@ async function main() {

await popup.click("#scanBtn");
await popup.waitForFunction(
() => document.querySelectorAll(".skeleton-card").length > 0,
() => document.querySelectorAll(".skeleton-row").length > 0,
{ timeout: options.timeoutMs }
);
const scanning = await captureEvidence(popup, reportDir, "page-scan-scanning");
Expand All @@ -670,8 +660,11 @@ async function main() {
await waitForVisibleResults(popup);
const resultsEvidence = await captureEvidence(popup, reportDir, "page-scan-results");
assert.equal(resultsEvidence.state.results.eventCards, 10);
assert.equal(resultsEvidence.state.results.pastCards, 10);
assert.equal(resultsEvidence.state.results.upcomingCards, 0);
assert.equal(
resultsEvidence.state.results.pastCards + resultsEvidence.state.results.upcomingCards,
10,
"all mock events should render across the upcoming/past lists"
);
assert.equal(resultsEvidence.state.addSelected.disabled, true);
assertFirstCardVisible(resultsEvidence.state, "page scan");
assertNoPopupOverflow(resultsEvidence.state);
Expand Down Expand Up @@ -740,7 +733,7 @@ async function main() {
);
const openEvidence = await captureEvidence(popup, reportDir, "custom-context-open");
assert.equal(openEvidence.state.customContext.hidden, false);
assert.equal(openEvidence.state.scanSection.hidden, true);
assert.ok(openEvidence.state.scanButton, "scan button stays in the toolbar while custom context is open");
assert.match(openEvidence.state.customContext.textareaValue, /Neighborhood potluck/);
assertNoPopupOverflow(openEvidence.state);
await closePage(popup);
Expand Down
34 changes: 17 additions & 17 deletions src/mocks/sample-events.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{
"title": "Team Sync Meeting",
"preview": "Team Sync",
"startDate": "2025-10-01",
"startDate": "2026-06-25",
"startTime": "09:00",
"endDate": "2025-10-01",
"endDate": "2026-06-25",
"endTime": "10:00",
"location": "Zoom",
"description": "Weekly team sync. Review progress and blockers.",
Expand All @@ -13,83 +13,83 @@
{
"title": "Product Launch Webinar",
"preview": "Launch Webinar",
"startDate": "2025-10-03",
"startDate": "2026-06-26",
"startTime": "13:30",
"endDate": "2025-10-03",
"endDate": "2026-06-26",
"endTime": "14:30",
"location": "YouTube Live",
"description": "Launch overview and live Q&A"
},
{
"title": "Coffee with Alex",
"preview": "Coffee w/ Alex",
"startDate": "2025-10-05",
"startDate": "2026-06-27",
"startTime": "08:15",
"location": "Blue Bottle, 3rd St.",
"description": "Catch-up"
},
{
"title": "Design Review",
"preview": "Design Review",
"startDate": "2025-10-06",
"startDate": "2026-06-28",
"startTime": "15:00",
"endDate": "2025-10-06",
"endDate": "2026-06-28",
"endTime": "16:00",
"location": "Conference Room B",
"description": "Review new UI mockups with the design team."
},
{
"title": "Dentist Appointment",
"preview": "Dentist",
"startDate": "2025-10-07",
"startDate": "2026-06-28",
"startTime": "11:30",
"location": "Downtown Dental Clinic",
"description": "Routine cleaning and checkup"
},
{
"title": "Yoga Class",
"preview": "Yoga",
"startDate": "2025-10-08",
"startDate": "2026-06-29",
"startTime": "18:00",
"endDate": "2025-10-08",
"endDate": "2026-06-29",
"endTime": "19:00",
"location": "Sunrise Yoga Studio",
"description": "Vinyasa flow class"
},
{
"title": "Board Game Night",
"preview": "Board Games",
"startDate": "2025-10-09",
"startDate": "2026-06-30",
"startTime": "19:30",
"location": "Sam's House",
"description": "Bring your favorite board game!"
},
{
"title": "Marketing Strategy Session",
"preview": "Marketing Strategy",
"startDate": "2025-10-10",
"startDate": "2026-07-01",
"startTime": "10:00",
"endDate": "2025-10-10",
"endDate": "2026-07-01",
"endTime": "12:00",
"location": "Office 2A",
"description": "Plan Q4 campaigns"
},
{
"title": "Parent-Teacher Conference",
"preview": "Parent-Teacher Conf",
"startDate": "2025-10-11",
"startDate": "2026-07-02",
"startTime": "16:00",
"endDate": "2025-10-11",
"endDate": "2026-07-02",
"endTime": "16:30",
"location": "Lincoln Elementary",
"description": "Discuss progress with Ms. Lee"
},
{
"title": "Birthday Party: Jamie",
"preview": "Jamie Birthday",
"startDate": "2025-10-12",
"startDate": "2026-07-05",
"startTime": "14:00",
"endDate": "2025-10-12",
"endDate": "2026-07-05",
"endTime": "17:00",
"location": "Central Park, Picnic Area 3",
"description": "Potluck and games"
Expand Down
Loading