Files
CPLv4.0/cypress/e2e/kue705fo.cy.ts
2025-01-26 20:47:56 +01:00

46 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

describe('Kue705FO Integration Tests', () => {
beforeEach(() => {
// Besuche die Seite, auf der die Komponente gerendert wird
//cy.visit('/path-to-your-component'); // Passe den Pfad an deine App an
cy.visit('http://localhost:3000/kabelueberwachung');
});
it('should render the component with default props', () => {
// Überprüfe, ob der Modulname und die Slotnummer angezeigt werden
cy.contains('KÜ705-FO').should('be.visible');
cy.contains('Modul 1').should('be.visible'); // Beispiel für den Modulnamen
});
it('should update display when TDR button is clicked', () => {
// Klicke auf den TDR-Button
cy.contains('TDR').click();
// Überprüfe, ob der Text aktualisiert wurde
cy.contains('Entfernung [Km]').should('be.visible');
});
it('should switch back to Schleife display', () => {
// Klicke auf TDR, dann zurück zu Schleife
cy.contains('TDR').click();
cy.contains('Schleife').click();
// Überprüfe, ob der Text aktualisiert wurde
cy.contains('Schleifenwiderstand [kOhm]').should('be.visible');
});
it('should disable TDR button when tdrActive is 0', () => {
// Dies erfordert eine benutzerdefinierte Backend-Konfiguration oder Redux-Manipulation
cy.contains('TDR').should('be.disabled');
});
it('should open and close the settings modal', () => {
// Öffne das Modal
cy.contains('⚙').click();
cy.contains('KUE Einstellung - Slot 1').should('be.visible');
// Schließe das Modal
cy.contains('×').click();
cy.contains('KUE Einstellung - Slot 1').should('not.exist');
});
});