🧪 restore deploy test gate
Browse files at this commit38b2f34d87964ba6808f34b62ec3f5324b429548Parent: 67be128- fix
- 🧪 restore deploy test gate
4 changed files +29 -19
- src/components/insights/insight-detail.test.tsx +26 -16
- src/components/insights/insight-run-report.test.tsx +1 -1
- src/components/layout/notification-center.tsx +1 -1
- src/components/notes/podcast-panel.test.tsx +1 -1
src/components/insights/insight-detail.test.tsxmodified+26 -16
| @@ -278,6 +278,12 @@ const renderInsight = (value: StudentInsight) => | ||
| 278 | 278 | </PreferencesProvider> |
| 279 | 279 | )); |
| 280 | 280 | |
| 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 | + | |
| 281 | 287 | /** The fixture's single course with its `trend` member swapped. */ |
| 282 | 288 | const marksWith = (trend: UnknownRecord): StudentInsight => { |
| 283 | 289 | const summary = insight.summary ?? { confidence: "none", computed_at: NOW, retain_until: NOW + WEEK }; |
| @@ -296,6 +302,8 @@ describe("InsightDetail", () => { | ||
| 296 | 302 | it("labels every module member in Turkish instead of echoing payload keys", () => { |
| 297 | 303 | renderDrawer(); |
| 298 | 304 | const human = screen.getByTestId("insight-human").textContent ?? ""; |
| 305 | + const marksDetail = openMarksCourse().textContent ?? ""; | |
| 306 | + const visible = `${human} ${marksDetail}`; | |
| 299 | 307 | |
| 300 | 308 | for (const label of [ |
| 301 | 309 | "Devam oranı", |
| @@ -306,7 +314,7 @@ describe("InsightDetail", () => { | ||
| 306 | 314 | "Şubedeki konumu", |
| 307 | 315 | "Yeterli veri yok", |
| 308 | 316 | ]) { |
| 309 | - expect(human, `label ${label}`).toContain(label); | |
| 317 | + expect(visible, `label ${label}`).toContain(label); | |
| 310 | 318 | } |
| 311 | 319 | expect(human).toContain("Dersler arası denge"); |
| 312 | 320 | expect(human).toContain("Yaklaşan teslimler"); |
| @@ -326,7 +334,7 @@ describe("InsightDetail", () => { | ||
| 326 | 334 | "n_marks", |
| 327 | 335 | "within_student_contrast", |
| 328 | 336 | ]) { |
| 329 | - expect(human, `raw key ${rawKey}`).not.toContain(rawKey); | |
| 337 | + expect(visible, `raw key ${rawKey}`).not.toContain(rawKey); | |
| 330 | 338 | } |
| 331 | 339 | }); |
| 332 | 340 | |
| @@ -345,17 +353,19 @@ describe("InsightDetail", () => { | ||
| 345 | 353 | it("renders the service's honest reasons as sentences", () => { |
| 346 | 354 | renderDrawer(); |
| 347 | 355 | const human = screen.getByTestId("insight-human").textContent ?? ""; |
| 356 | + const marksDetail = openMarksCourse().textContent ?? ""; | |
| 357 | + const visible = `${human} ${marksDetail}`; | |
| 348 | 358 | |
| 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."); | |
| 355 | 365 | // A rate-space difference is percentage points: -0.16 is "-16 puan", not |
| 356 | 366 | // "-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"); | |
| 359 | 369 | }); |
| 360 | 370 | |
| 361 | 371 | it("keeps the whole raw payload in the collapsed technical disclosure", () => { |
| @@ -428,10 +438,10 @@ describe("InsightDetail", () => { | ||
| 428 | 438 | rising: false, |
| 429 | 439 | }), |
| 430 | 440 | ); |
| 431 | - const human = screen.getByTestId("insight-human").textContent ?? ""; | |
| 441 | + const marksDetail = openMarksCourse().textContent ?? ""; | |
| 432 | 442 | |
| 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"); | |
| 435 | 445 | }); |
| 436 | 446 | |
| 437 | 447 | it("shows the slope row when the trend computed one", () => { |
| @@ -448,10 +458,10 @@ describe("InsightDetail", () => { | ||
| 448 | 458 | rising: false, |
| 449 | 459 | }), |
| 450 | 460 | ); |
| 451 | - const human = screen.getByTestId("insight-human").textContent ?? ""; | |
| 461 | + const marksDetail = openMarksCourse().textContent ?? ""; | |
| 452 | 462 | |
| 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ı"); | |
| 455 | 465 | }); |
| 456 | 466 | |
| 457 | 467 | 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 = { | ||
| 147 | 147 | |
| 148 | 148 | const INSIGHT_S3: StudentInsight = { user_id: "s3", summary: null, attention: [], cards: [], segments: [] }; |
| 149 | 149 | |
| 150 | -const panel = () => within(document.querySelector(".side-panel-body") as HTMLElement); | |
| 150 | +const panel = () => within(screen.getByRole("region", { name: /^Çalıştırma günü / })); | |
| 151 | 151 | |
| 152 | 152 | async function openReport(runDay: string) { |
| 153 | 153 | render(() => ( |
src/components/layout/notification-center.tsxmodified+1 -1
| @@ -353,7 +353,7 @@ export function NotificationCenter() { | ||
| 353 | 353 | {notificationGroupLabel(group.type)} |
| 354 | 354 | </span> |
| 355 | 355 | </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"> | |
| 357 | 357 | {group.items.length} |
| 358 | 358 | </span> |
| 359 | 359 | </div> |
src/components/notes/podcast-panel.test.tsxmodified+1 -1
| @@ -42,7 +42,7 @@ describe("PodcastPanel", () => { | ||
| 42 | 42 | </PreferencesProvider> |
| 43 | 43 | )); |
| 44 | 44 | |
| 45 | - fireEvent.change(screen.getByLabelText("Narration style"), { target: { value: "tek_ogretici" } }); | |
| 45 | + fireEvent.change(await screen.findByLabelText("Narration style"), { target: { value: "tek_ogretici" } }); | |
| 46 | 46 | fireEvent.click(screen.getByRole("button", { name: "Create podcast" })); |
| 47 | 47 | |
| 48 | 48 | await waitFor(() => { |