From 17d4973ab814aac92dcf3689c300f99ece803d0c Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 16 Sep 2024 18:41:25 +0530 Subject: [PATCH] test: fixed course creation --- cypress/e2e/course_creation.cy.js | 20 -------------------- frontend/src/pages/Lesson.vue | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/cypress/e2e/course_creation.cy.js b/cypress/e2e/course_creation.cy.js index e453ea5b..3e28b0a5 100644 --- a/cypress/e2e/course_creation.cy.js +++ b/cypress/e2e/course_creation.cy.js @@ -61,21 +61,7 @@ describe("Course Creation", () => { cy.wait(1000); cy.get("label").contains("Title").type("Test Lesson"); - /* cy.get("#content .ce-block") - .click() - .invoke("text", "https://www.youtube.com/watch?v=GoDtyItReto"); */ - /* cy.get("#content .ce-block") - .click() - .paste("https://www.youtube.com/watch?v=GoDtyItReto"); */ - cy.fixture("Youtube.mov", "base64").then((fileContent) => { - cy.get('input[type="file"]').attachFile({ - fileContent, - fileName: "Youtube.mov", - mimeType: "image/png", - encoding: "base64", - }); - }); cy.get("#content .ce-block").type( "This is an extremely big paragraph that is meant to test the UI. This is a very long paragraph. 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." ); @@ -119,12 +105,6 @@ describe("Course Creation", () => { cy.url().should("include", "/learn/1-1"); cy.get("div").contains("Test Lesson"); - cy.get("video") - .should("be.visible") - .children("source") - .invoke("attr", "src") - .should("include", "/files/Youtube"); - cy.get("div").contains( "This is an extremely big paragraph that is meant to test the UI. This is a very long paragraph. 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." ); diff --git a/frontend/src/pages/Lesson.vue b/frontend/src/pages/Lesson.vue index f0727d3c..a4a8ba5d 100644 --- a/frontend/src/pages/Lesson.vue +++ b/frontend/src/pages/Lesson.vue @@ -244,7 +244,7 @@ const lesson = createResource({ onSuccess(data) { lessonProgress.value = data.membership?.progress if (data.content) editor.value = renderEditor('editor', data.content) - if (JSON.parse(data.instructor_content)?.blocks?.length) + if (JSON.parse(data.instructor_content)?.blocks?.length > 1) instructorEditor.value = renderEditor( 'instructor-content', data.instructor_content