forge
Explore
Log in

Don't you dare go Hollow

🧪 restore deploy test gate

Browse files at this commit

38b2f34d87964ba6808f34b62ec3f5324b429548Burak BoduroğluParent: 67be128
  • fix
    • 🧪 restore deploy test gate
Show full message
fix: 🧪 restore deploy test gate

- align insight report and course-detail tests with the refined inline and panel flows
- wait for podcast capabilities before interacting with the Suspense-backed form
- bring the notification count badge back within the minimum text-size rule
src/components/insights/insight-detail.test.tsxmodified+26 -16
@@ -278,6 +278,12 @@ const renderInsight = (value: StudentInsight) =>
278278 </PreferencesProvider>
279279 ));
280280
281+const openMarksCourse = () => {
282+ const courseRow = screen.getByRole("cell", { name: "Matematik" }).closest("tr") as HTMLElement;
283+ fireEvent.click(courseRow);
284+ return screen.getByRole("dialog", { name: "Matematik" });
285+};
286+
281287 /** The fixture's single course with its `trend` member swapped. */
282288 const marksWith = (trend: UnknownRecord): StudentInsight => {
283289 const summary = insight.summary ?? { confidence: "none", computed_at: NOW, retain_until: NOW + WEEK };
@@ -296,6 +302,8 @@ describe("InsightDetail", () => {
296302 it("labels every module member in Turkish instead of echoing payload keys", () => {
297303 renderDrawer();
298304 const human = screen.getByTestId("insight-human").textContent ?? "";
305+ const marksDetail = openMarksCourse().textContent ?? "";
306+ const visible = `${human} ${marksDetail}`;
299307
300308 for (const label of [
301309 "Devam oranı",
@@ -306,7 +314,7 @@ describe("InsightDetail", () => {
306314 "Şubedeki konumu",
307315 "Yeterli veri yok",
308316 ]) {
309- expect(human, `label ${label}`).toContain(label);
317+ expect(visible, `label ${label}`).toContain(label);
310318 }
311319 expect(human).toContain("Dersler arası denge");
312320 expect(human).toContain("Yaklaşan teslimler");
@@ -326,7 +334,7 @@ describe("InsightDetail", () => {
326334 "n_marks",
327335 "within_student_contrast",
328336 ]) {
329- expect(human, `raw key ${rawKey}`).not.toContain(rawKey);
337+ expect(visible, `raw key ${rawKey}`).not.toContain(rawKey);
330338 }
331339 });
332340
@@ -345,17 +353,19 @@ describe("InsightDetail", () => {
345353 it("renders the service's honest reasons as sentences", () => {
346354 renderDrawer();
347355 const human = screen.getByTestId("insight-human").textContent ?? "";
356+ const marksDetail = openMarksCourse().textContent ?? "";
357+ const visible = `${human} ${marksDetail}`;
348358
349- expect(human).toContain("eğilim için en az 6 not gerekir");
350- expect(human).toContain("Veri toplanıyor (2/3)");
351- expect(human).toContain("kontrast için bantlanmış en az 3 ders gerekir");
352- expect(human).toContain("Isı haritası için 3/5 oturum");
353- expect(human).toContain("Erteleme profili submitted_at gerektirir");
354- expect(human).toContain("Dönem kümülatifi; son 30 gün penceresi yok.");
359+ expect(visible).toContain("eğilim için en az 6 not gerekir");
360+ expect(visible).toContain("Veri toplanıyor (2/3)");
361+ expect(visible).toContain("kontrast için bantlanmış en az 3 ders gerekir");
362+ expect(visible).toContain("Isı haritası için 3/5 oturum");
363+ expect(visible).toContain("Erteleme profili submitted_at gerektirir");
364+ expect(visible).toContain("Dönem kümülatifi; son 30 gün penceresi yok.");
355365 // A rate-space difference is percentage points: -0.16 is "-16 puan", not
356366 // "-0,2 puan" — the raw number must never leak through unconverted.
357- expect(human).toContain("-16 puan");
358- expect(human).toContain("-4 puan");
367+ expect(visible).toContain("-16 puan");
368+ expect(visible).toContain("-4 puan");
359369 });
360370
361371 it("keeps the whole raw payload in the collapsed technical disclosure", () => {
@@ -428,10 +438,10 @@ describe("InsightDetail", () => {
428438 rising: false,
429439 }),
430440 );
431- const human = screen.getByTestId("insight-human").textContent ?? "";
441+ const marksDetail = openMarksCourse().textContent ?? "";
432442
433- expect(human).toContain(reason);
434- expect(human).not.toContain("/ 30 gün");
443+ expect(marksDetail).toContain(reason);
444+ expect(marksDetail).not.toContain("/ 30 gün");
435445 });
436446
437447 it("shows the slope row when the trend computed one", () => {
@@ -448,10 +458,10 @@ describe("InsightDetail", () => {
448458 rising: false,
449459 }),
450460 );
451- const human = screen.getByTestId("insight-human").textContent ?? "";
461+ const marksDetail = openMarksCourse().textContent ?? "";
452462
453- expect(human).toContain("+3,4 puan / 30 gün");
454- expect(human).not.toContain("eğim hesaplanmadı");
463+ expect(marksDetail).toContain("+3,4 puan / 30 gün");
464+ expect(marksDetail).not.toContain("eğim hesaplanmadı");
455465 });
456466
457467 it("keeps the cards-only mode free of the drawer's full-view sections", () => {
src/components/insights/insight-run-report.test.tsxmodified+1 -1
@@ -147,7 +147,7 @@ const INSIGHT_S2: StudentInsight = {
147147
148148 const INSIGHT_S3: StudentInsight = { user_id: "s3", summary: null, attention: [], cards: [], segments: [] };
149149
150-const panel = () => within(document.querySelector(".side-panel-body") as HTMLElement);
150+const panel = () => within(screen.getByRole("region", { name: /^Çalıştırma günü / }));
151151
152152 async function openReport(runDay: string) {
153153 render(() => (
src/components/layout/notification-center.tsxmodified+1 -1
@@ -353,7 +353,7 @@ export function NotificationCenter() {
353353 {notificationGroupLabel(group.type)}
354354 </span>
355355 </div>
356- <span class="shrink-0 rounded-full bg-background/70 px-1.5 py-0.5 font-mono text-[10px] font-bold text-text-subtle">
356+ <span class="shrink-0 rounded-full bg-background/70 px-1.5 py-0.5 font-mono text-[11px] font-bold text-text-subtle">
357357 {group.items.length}
358358 </span>
359359 </div>
src/components/notes/podcast-panel.test.tsxmodified+1 -1
@@ -42,7 +42,7 @@ describe("PodcastPanel", () => {
4242 </PreferencesProvider>
4343 ));
4444
45- fireEvent.change(screen.getByLabelText("Narration style"), { target: { value: "tek_ogretici" } });
45+ fireEvent.change(await screen.findByLabelText("Narration style"), { target: { value: "tek_ogretici" } });
4646 fireEvent.click(screen.getByRole("button", { name: "Create podcast" }));
4747
4848 await waitFor(() => {