Skip to content
Open
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
11 changes: 11 additions & 0 deletions design-1.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"folders": [
{
"path": "design-1"
},
{
"path": "my-app"
}
],
"settings": {}
}
3 changes: 3 additions & 0 deletions my-app/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
5 changes: 5 additions & 0 deletions my-app/.firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bundle.js,1730624234266,99aadd044a1230e5bf9063744474ff55c117267ba555775476fd34698c00ebeb
8d2c2dc93ac1a2586d66.svg,1730624234270,d647fddf9e402a5d0ecab1b22d67bf27f59520c225a71e439b141709c2b363b9
5fd60134b1ee660d1619.png,1730624234265,81fbcb4dc3dbde17c7f7ebf895ef409fac89a0a542297f7d6912355ef8381a59
040c48971795b4b6a64a.jpg,1730624234265,c2c5543759f8bdfddc3bf57332c4953f66283e3ee190f5fccdf0bc02bdab0e4d
index.html,1730626236926,1e6781846f576a1a2688abdfe2c45e1db3db705cacc223bf7077ab9b6328f7fc
5 changes: 5 additions & 0 deletions my-app/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "folder-manager-41155"
}
}
1 change: 1 addition & 0 deletions my-app/__mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'test-file-stub';
2 changes: 1 addition & 1 deletion my-app/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require('path');
const path = require('node:path');
const HtmlWebPackPlugin = require('html-webpack-plugin');

const basicConfig = {
Expand Down
1 change: 1 addition & 0 deletions my-app/config/webpack.cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { merge } = require('webpack-merge');
const basicConfig = require('./webpack.config');

const config = {
mode: 'development',
module: {
Expand Down
1 change: 1 addition & 0 deletions my-app/config/webpack.development.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { merge } = require("webpack-merge");
const basicConfig = require("./webpack.config");

const config = {
mode: "development",
module: {
Expand Down
47 changes: 47 additions & 0 deletions my-app/cypress/e2e/firstTest.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,50 @@ describe('template spec', () => {
cy.get('[data-testid="cypress-titel"]').should('exist');
});
});

describe(' E2E Tests', () => {
beforeEach(() => {
cy.visit(' http://localhost:9000');
});
it('should display an error for invalid email format', () => {
cy.get('input[type="email"]').type('invalid-email');
cy.get('input[type="password"]').type('password123');
cy.get('button').contains('Create an account').click();

cy.on('window:alert', (str) => {
expect(str).to.equal('Invalid email format');
});
});

it('should display register form by default', () => {
cy.contains('Register');
cy.get('input[type="email"]').should('be.visible');
cy.get('input[type="password"]').should('be.visible');
});

it('should allow user to register', () => {
cy.get('input[type="email"]').type('testuser@e2w029amplwd.com');
cy.get('input[type="password"]').type('password12');
cy.get('button').contains('Create an account').click();

cy.url().should('include', '/private');
});
it('Create folder', () => {
cy.get('[data-testid="cypressCrtBtn"]').click();
cy.get('input[type="text"]').type('Привіт');
cy.get('input[type="color"]').invoke('val', '#ff0000').trigger('input').trigger('change');
cy.get("input[type='submit']").click();
});
it('Click on Settings page', () => {
cy.get('a').contains('Settings').click();
});
it('Click on About page', () => {
cy.get('a').contains('About').click();
});
it('Click on About page', () => {
cy.get('a').contains('Home').click();
});
it('Sing out', () => {
cy.get('button').contains('logout').click();
});
});
11 changes: 11 additions & 0 deletions my-app/cypress/e2e/login.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('template spec', () => {
beforeEach(() => {
cy.visit(' http://localhost:9000');
});
it('Login form', () => {
cy.get('a').contains('Login').click();
cy.get('input[type="email"]').type('folder.mg@gmail.com');
cy.get('input[type="password"]').type('123456');
cy.get('button').contains('Login').click();
});
});
1 change: 0 additions & 1 deletion my-app/cypress/support/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/react18';

Cypress.Commands.add('mount', mount);
Expand Down
16 changes: 16 additions & 0 deletions my-app/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
14 changes: 14 additions & 0 deletions my-app/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
testEnvironment: 'jsdom', // Вказуємо, що середовище - це браузер
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleNameMapper: {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|svg)$': '<rootDir>/__mocks__/fileMock.js',
},
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
testPathIgnorePatterns: ['/node_modules/', '/build/'],
collectCoverage: true,
coverageReporters: ['text', 'lcov'],
};
1 change: 1 addition & 0 deletions my-app/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom';
Loading