Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const config: any = {
videosFolder: 'cypress/videos',
downloadsFolder: 'cypress/downloads',
baseUrl: 'https://text-compare.netlify.app',
pageLoadTimeout: 120000, // 2 minutes
setupNodeEvents(on, cfg) {
// keep default behavior; add plugins here if needed
return cfg;
Expand Down
11 changes: 6 additions & 5 deletions cypress/integration/home.cy.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/// <reference types="cypress" />

describe('Text Compare App', () => {
const delay = 1000; // 1 second

beforeEach(() => {
cy.visit('https://text-compare.netlify.app/');
cy.visit('/');
cy.wait(delay); // wait 1 second before running each test
});

it('should display the app name on the home page', () => {
cy.visit('/');
cy.contains('Text Compare');
cy.contains('Netlify');
cy.get('h1').should('contain.text', 'Text Compare');
});

it('should display two text boxes and a compare button', () => {
cy.visit('/');
cy.get('#editor1').should('be.visible');
cy.get('#editor2').should('be.visible');
cy.contains('button', 'Compare').should('be.visible');
Expand All @@ -23,8 +24,8 @@ describe('Text Compare App', () => {
const left = 'Hello World';
const right = 'Hello world';

cy.get('#editor1').clear().type(left);
cy.get('#editor2').clear().type(right);
cy.get('#editor1').clear().type(left, { delay: 200 }); // 200ms between keystrokes
cy.get('#editor2').clear().type(right, { delay: 200 });

cy.contains('button', 'Compare').click();
cy.get('#diffeditor').should('be.visible');
Expand Down
3 changes: 1 addition & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { APP_BASE_HREF } from '@angular/common';

import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
Expand Down Expand Up @@ -31,7 +30,7 @@ import { environment } from '../environments/environment';
baseUrl: environment.monacoBaseUrl
})
],
providers: [{ provide: APP_BASE_HREF, useValue: environment.baseHref }],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
3 changes: 1 addition & 2 deletions src/environments/environment.azure.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const environment = {
production: true,
envName: 'Azure',
baseHref: '/',
monacoBaseUrl: '/assets/monaco/min/vs'
monacoBaseUrl: ''
};
3 changes: 1 addition & 2 deletions src/environments/environment.nas.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const environment = {
production: true,
envName: 'Nas',
baseHref: '/',
monacoBaseUrl: '/assets/monaco/min/vs'
monacoBaseUrl: ''
};
3 changes: 1 addition & 2 deletions src/environments/environment.netlify.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const environment = {
production: true,
envName: 'Netlify',
baseHref: '/',
monacoBaseUrl: '/assets/monaco/min/vs'
monacoBaseUrl: ''
};
3 changes: 1 addition & 2 deletions src/environments/environment.pages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const environment = {
production: true,
envName: 'GitHub Pages',
baseHref: '/text-compare-angular/',
monacoBaseUrl: '/assets/monaco/min/vs'
monacoBaseUrl: ''
};
1 change: 0 additions & 1 deletion src/environments/environment.pages2.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const environment = {
production: true,
envName: 'GitHub Pages',
baseHref: '/',
monacoBaseUrl: '/text-compare-angular/assets/monaco/min/vs'
};
3 changes: 1 addition & 2 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const environment = {
production: true,
envName: 'Production',
baseHref: '/',
monacoBaseUrl: '/assets/monaco/min/vs'
monacoBaseUrl: ''
};
3 changes: 1 addition & 2 deletions src/environments/environment.render.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const environment = {
production: true,
envName: 'Render',
baseHref: '/',
monacoBaseUrl: '/assets/monaco/min/vs'
monacoBaseUrl: ''
};
3 changes: 1 addition & 2 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
export const environment = {
production: false,
envName: 'Local',
baseHref: '/',
monacoBaseUrl: '/assets/monaco/min/vs'
monacoBaseUrl: ''
};