import { login } from "./helpers"; describe("courseSpecificSettings.cy.js", () => { describe("uk Course", () => { beforeEach(() => { cy.manageCommand("cypress_reset --set-only-is-uk-flag"); }); describe("as member", () => { beforeEach(() => { login("test-student1@example.com", "test"); }); it("should display 'Selbsteinschätzung in üK'", () => { cy.visit( "/course/test-lehrgang/competence/self-evaluation-and-feedback" ); cy.get('[data-cy="self-evaluation-title"]').contains( "Selbsteinschätzung", { matchCase: false, exact: true } ); cy.get( '[data-cy="self-evaluation-and-feedback-navigation-link"]' ).contains("Selbsteinschätzung", { matchCase: false, exact: true, }); }); it("should display 'Praxisbildner'", () => { cy.visit("/course/test-lehrgang/learn"); cy.get('[data-cy="navigation-learning-mentor-link"]').contains( "Praxisbildner" ); cy.get('[data-cy="navigation-learning-mentor-link"]').click(); cy.get('[data-cy="lm-my-lms-title"]').contains("Meine Praxisbildner"); cy.get('[data-cy="lm-invite-mentor-button"]').contains( "Neuen Praxisbildner einladen" ); }); it("should display trainer in contact box", () => { cy.visit("/course/test-lehrgang/learn/fahrzeug#ls-vorbereitung"); cy.get('[data-cy="circle-contact-description"]').contains( "Tausche dich mit der Trainer/-in für den Circle Fahrzeug aus." ); }); }); describe("as trainer", () => { beforeEach(() => { login("test-trainer1@example.com", "test"); }); it("should not display the feedback panel in public profile", () => { cy.visit("/dashboard/persons"); cy.get('[data-cy="person-learning-path-link"]').first().click(); cy.get('[data-cy="profileCompetence"]').click(); cy.get('[data-cy="evaluation-overview-selfevaluation-block"]').should( "exist" ); cy.get('[data-cy="evaluation-overview-feedback-block"]').should( "not.exist" ); }); }); }); describe("VV course", () => { beforeEach(() => { cy.manageCommand( "cypress_reset --set-only-is-vv-flag --create-learning-mentor" ); }); describe("as member", () => { beforeEach(() => { login("test-student1@example.com", "test"); }); it("should display 'Selbst- und Fremdeinschätzung in VV'", () => { cy.visit( "/course/test-lehrgang/competence/self-evaluation-and-feedback" ); cy.get('[data-cy="self-evaluation-title"]').contains( "Selbst- und Fremdeinschätzung", { matchCase: false, exact: true } ); cy.get( '[data-cy="self-evaluation-and-feedback-navigation-link"]' ).contains("Selbst- und Fremdeinschätzung", { matchCase: false, exact: true, }); }); it("should display 'Lernbegleitung'", () => { cy.visit("/course/test-lehrgang/learn"); cy.get('[data-cy="navigation-learning-mentor-link"]').contains( "Lernbegleitung" ); cy.get('[data-cy="navigation-learning-mentor-link"]').click(); cy.get('[data-cy="lm-my-lms-title"]').contains("Meine Lernbegleitung"); cy.get('[data-cy="lm-invite-mentor-button"]').contains( "Neue Lernbegleitung einladen" ); }); it("should display lernbegleitung in contact box", () => { cy.visit("/course/test-lehrgang/learn/fahrzeug#ls-vorbereitung"); cy.get('[data-cy="circle-contact-description"]').contains( "Tausche dich mit deiner Lernbegleitung aus." ); }); }); }); describe("as mentor", () => { beforeEach(() => { login("test-mentor1@example.com", "test"); }); it("should display the feedback panel in public profile", () => { cy.visit("/dashboard/persons"); cy.get('[data-cy="person-learning-path-link"]').first().click(); cy.get('[data-cy="profileCompetence"]').click(); cy.get('[data-cy="evaluation-overview-selfevaluation-block"]').should( "exist" ); cy.get('[data-cy="evaluation-overview-feedback-block"]').should("exist"); }); }); });