export const login = (username, password) => {
    cy.request({
        method: "POST", url: "/api/core/login/", body: {username, password},
    });
};

export const logout = () => {
    cy.request({
        method: "POST", url: "/api/core/logout/",
    });
};

export const BASE_URL = "/course/test-lehrgang";
export const EXPERT_LOGIN = ["test-trainer1@example.com", "test"];
export const PARTICIPANT_LOGIN = ["test-student1@example.com", "test"];

export const visitCoursePage = (subPath) => {
    cy.visit(`${BASE_URL}/${subPath}`);
}

export const checkNavigationLink = (dataCy, expectedLink) => {
    cy.get(`[data-cy="${dataCy}"]`).should('have.attr', 'href').and('eq', `${BASE_URL}/${expectedLink}`);
}
