From 6f86b822bf89aeaf6eaf6e9580bdcbb2d4fdfb19 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 18 Feb 2026 10:58:49 +0530 Subject: [PATCH] fix: mobile view for batch dashboard --- cypress/e2e/batch_creation.cy.js | 25 ++++++++----------- frontend/components.d.ts | 3 --- frontend/src/pages/Batches/BatchDetail.vue | 5 +++- frontend/src/pages/Batches/BatchForm.vue | 4 +-- .../components/AdminBatchDashboard.vue | 8 +++--- .../Batches/components/Announcements.vue | 4 +-- .../Batches/components/BatchDashboard.vue | 2 +- .../components/BatchStudentProgress.vue | 2 +- .../pages/Batches/components/LiveClass.vue | 6 ++--- 9 files changed, 28 insertions(+), 31 deletions(-) diff --git a/cypress/e2e/batch_creation.cy.js b/cypress/e2e/batch_creation.cy.js index 653a70a2..61497afd 100644 --- a/cypress/e2e/batch_creation.cy.js +++ b/cypress/e2e/batch_creation.cy.js @@ -54,25 +54,21 @@ describe("Batch Creation", () => { cy.get("button").contains("Create").click(); cy.get("span").contains("New Batch").click(); cy.wait(500); - cy.url().should("include", "/batches/new/edit"); cy.get("label").contains("Title").type("Test Batch"); - cy.get("label").contains("Start Date").type("2030-10-01"); cy.get("label").contains("End Date").type("2030-10-31"); cy.get("label").contains("Start Time").type("10:00"); cy.get("label").contains("End Time").type("11:00"); cy.get("label").contains("Timezone").type("IST"); cy.get("label").contains("Seat Count").type("10"); - cy.get("label").contains("Published").click(); cy.get("label") - .contains("Short Description") + .contains("Description") .type("Test Batch Short Description to test the UI"); cy.get("div[contenteditable=true").invoke( "text", "Test Batch Description. I need a very big description to test the UI. This is a very big description. It contains more than once sentence. Its meant to be this long as this is a UI test. Its unbearably long and I'm not sure why I'm typing this much. I'm just going to keep typing until I feel like its long enough. I think its long enough now. I'm going to stop typing now." ); - /* Instructor */ cy.get("label") .contains("Instructors") @@ -90,13 +86,14 @@ describe("Batch Creation", () => { cy.get("[id^=headlessui-combobox-option-").first().click(); }); }); - + cy.button("Save").click(); + cy.get("label").contains("Published").click(); cy.button("Save").click(); cy.wait(1000); let batchName; cy.url().then((url) => { console.log(url); - batchName = url.split("/").pop(); + batchName = url.split("/").pop().split("#")[0]; cy.wrap(batchName).as("batchName"); }); cy.wait(500); @@ -115,7 +112,7 @@ describe("Batch Creation", () => { .click(); cy.get("@batchName").then((batchName) => { - cy.get(`a[href='/lms/batches/details/${batchName}'`).within(() => { + cy.get(`a[href='/lms/batches/${batchName}'`).within(() => { cy.get("div").contains("Test Batch").should("be.visible"); cy.get("div") .contains("Test Batch Short Description to test the UI") @@ -135,7 +132,7 @@ describe("Batch Creation", () => { .contains("Seats Left") .should("be.visible"); }); - cy.get(`a[href='/lms/batches/details/${batchName}'`).click(); + cy.get(`a[href='/lms/batches/${batchName}'`).click(); }); cy.get("div").contains("Test Batch").should("be.visible"); @@ -157,14 +154,14 @@ describe("Batch Creation", () => { "Test Batch Description. I need a very big description to test the UI. This is a very big description. It contains more than once sentence. Its meant to be this long as this is a UI test. Its unbearably long and I'm not sure why I'm typing this much. I'm just going to keep typing until I feel like its long enough. I think its long enough now. I'm going to stop typing now." ) .should("be.visible"); - cy.get("button:visible").contains("Manage Batch").click(); + cy.get("button:visible").contains("Dashboard").click(); /* Add student to batch */ - cy.get("button").contains("Students").click(); - cy.get("button").contains("Add").click(); + cy.get("button").contains("Enroll").click(); cy.get('div[role="dialog"]') .first() - .find("input[id^='headlessui-combobox-input-v-']") + .find("div[label='Student']") + .find("button") .first() .click(); cy.get("input[placeholder='Search']").type(randomEmail); @@ -172,7 +169,7 @@ describe("Batch Creation", () => { cy.get("button").contains("Submit").click(); // Verify Seat Count - cy.get("span").contains("Details").click(); + cy.get("button:visible").contains("Overview").click(); cy.contains("div:visible", "9 Seats Left").should("be.visible"); }); }); diff --git a/frontend/components.d.ts b/frontend/components.d.ts index c357c9da..42b89f05 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -8,7 +8,6 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { - AnnouncementModal: typeof import('./src/components/Modals/AnnouncementModal.vue')['default'] Apps: typeof import('./src/components/Sidebar/Apps.vue')['default'] AppSidebar: typeof import('./src/components/Sidebar/AppSidebar.vue')['default'] AssessmentModal: typeof import('./src/components/Modals/AssessmentModal.vue')['default'] @@ -22,9 +21,7 @@ declare module 'vue' { BadgeForm: typeof import('./src/components/Settings/BadgeForm.vue')['default'] Badges: typeof import('./src/components/Settings/Badges.vue')['default'] BatchCourseModal: typeof import('./src/components/Modals/BatchCourseModal.vue')['default'] - BatchStudentProgress: typeof import('./src/components/Modals/BatchStudentProgress.vue')['default'] BrandSettings: typeof import('./src/components/Settings/BrandSettings.vue')['default'] - BulkCertificates: typeof import('./src/components/Modals/BulkCertificates.vue')['default'] Categories: typeof import('./src/components/Settings/Categories.vue')['default'] CertificationLinks: typeof import('./src/components/CertificationLinks.vue')['default'] ChapterModal: typeof import('./src/components/Modals/ChapterModal.vue')['default'] diff --git a/frontend/src/pages/Batches/BatchDetail.vue b/frontend/src/pages/Batches/BatchDetail.vue index 58d4787e..a3a83f18 100644 --- a/frontend/src/pages/Batches/BatchDetail.vue +++ b/frontend/src/pages/Batches/BatchDetail.vue @@ -37,7 +37,10 @@