Skip to content

Commit 3e971e7

Browse files
authored
1.0.0-beta-2
1.0.0-beta-2
2 parents f9f178a + b2ae77c commit 3e971e7

133 files changed

Lines changed: 8523 additions & 3619 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414
"plugin:prettier/recommended",
1515
"plugin:storybook/recommended"
1616
],
17-
"plugins": ["unused-imports", "@ngneat/reactive-forms"],
17+
"plugins": ["@ngneat/reactive-forms"],
1818
"rules": {
1919
"@angular-eslint/no-empty-lifecycle-method": "warn",
2020
"comma-dangle": ["error", "always-multiline"],
2121
"@typescript-eslint/comma-dangle": ["error", "only-multiline"],
2222
"storybook/prefer-pascal-case": "off",
2323
"no-unused-vars": "off",
24-
"unused-imports/no-unused-imports": "error",
25-
"unused-imports/no-unused-vars": [
26-
"warn",
27-
{
28-
"vars": "all",
29-
"varsIgnorePattern": "^_",
30-
"args": "after-used",
31-
"argsIgnorePattern": "^_"
32-
}
33-
],
24+
// "unused-imports/no-unused-imports": "error",
25+
// "unused-imports/no-unused-vars": [
26+
// "warn",
27+
// {
28+
// "vars": "all",
29+
// "varsIgnorePattern": "^_",
30+
// "args": "after-used",
31+
// "argsIgnorePattern": "^_"
32+
// }
33+
// ],
3434
"@ngneat/reactive-forms/no-angular-forms-imports": "error"
3535
}
3636
},

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@
7979
/* ==== Spelling ==== */
8080
/* ================== */
8181
"cSpell.words": [
82+
"auditlog",
8283
"compodoc",
8384
"devkit",
85+
"Donte",
8486
"lcov",
8587
"ngneat",
8688
"protobuf",

angular.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@
5454
],
5555
"assets": [
5656
"src/favicon.ico",
57-
"src/assets"
57+
"src/assets",
58+
{
59+
"glob": "**/*",
60+
"input": "node_modules/monaco-editor",
61+
"output": "/assets/monaco/"
62+
}
5863
],
5964
"styles": [
6065
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
@@ -68,7 +73,7 @@
6873
"scripts": []
6974
},
7075
"configurations": {
71-
"prod": {
76+
"production": {
7277
"budgets": [
7378
{
7479
"type": "initial",
@@ -127,7 +132,13 @@
127132
"vendorChunk": true,
128133
"customWebpackConfig": {
129134
"path": "./cypress/coverage.webpack.ts"
130-
}
135+
},
136+
"fileReplacements": [
137+
{
138+
"replace": "src/environments/environment.ts",
139+
"with": "src/environments/environment.dev.ts"
140+
}
141+
]
131142
}
132143
},
133144
"defaultConfiguration": "production"
@@ -264,8 +275,10 @@
264275
}
265276
}
266277
},
267-
"defaultProject": "vernite",
268278
"cli": {
269-
"defaultCollection": "@angular-eslint/schematics"
279+
"schematicCollections": [
280+
"@angular-eslint/schematics"
281+
],
282+
"analytics": "7dc2ed6f-e15e-44f8-8497-32ad73c688d3"
270283
}
271284
}
Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import auth from '../fixtures/auth.json';
22

33
describe('Projects tests', () => {
4+
const rand = Math.random();
5+
46
before(() => {
57
cy.logout();
68
cy.login(auth.email, auth.password);
7-
cy.createWorkspace('Test workspace');
89
});
910

1011
beforeEach(() => {
@@ -14,34 +15,40 @@ describe('Projects tests', () => {
1415
});
1516

1617
it('Should be able to create a new project', () => {
17-
cy.contains('td', 'Test workspace').click();
18+
cy.contains('td', 'test workspace ').click();
1819
cy.contains('New project').click();
19-
cy.get('input[name=name]').type('Test project');
20+
cy.get('input[name=name]').type('Test project ' + rand);
2021
cy.contains('button', 'Create project').click();
2122
});
2223

2324
it('Should not be able to create a new project without name', () => {
24-
cy.contains('td', 'Test workspace').click();
25-
cy.contains('New project').click();
25+
cy.contains('td', 'test workspace').click();
26+
cy.contains('button[type=submit]', 'New project').click();
2627
cy.wait(2000);
2728
cy.contains('button', 'Create project').click();
2829
cy.contains('is required');
2930
});
3031

3132
it('Should be able to edit a project', () => {
32-
cy.contains('td', 'Test workspace').click();
33-
cy.contains('tr', 'Test project').find('.mat-menu-trigger').click();
33+
cy.contains('td', 'test workspace').click();
34+
cy.contains('tr', 'Test project ' + rand)
35+
.find('.mat-menu-trigger')
36+
.click();
3437
cy.contains('Edit').click();
35-
cy.get('input[name=name]').clear().type('Test project - renamed');
38+
cy.get('input[name=name]')
39+
.clear()
40+
.type('Test project - renamed ' + rand);
3641
cy.contains('button', 'Save changes').click();
37-
cy.contains('Test project - renamed');
42+
cy.contains('Test project - renamed ' + rand);
3843
});
3944

4045
it('Should be able to delete a project', () => {
41-
cy.contains('td', 'Test workspace').click();
42-
cy.contains('tr', 'Test project - renamed').find('.mat-menu-trigger').click();
46+
cy.contains('td', 'test workspace').click();
47+
cy.contains('tr', 'Test project - renamed ' + rand)
48+
.find('.mat-menu-trigger')
49+
.click();
4350
cy.contains('Delete').click();
4451
cy.get('.mat-dialog-container').contains('button', 'Delete').click();
45-
cy.contains('Test project - renamed').should('not.exist');
52+
cy.contains('Test project - renamed ' + rand).should('not.exist');
4653
});
4754
});

cypress/integration/task.spec.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import auth from '../fixtures/auth.json';
2+
3+
describe('Task tests', () => {
4+
const rand = Math.random();
5+
6+
before(() => {
7+
cy.logout();
8+
cy.login(auth.email, auth.password);
9+
});
10+
11+
beforeEach(() => {
12+
cy.logout();
13+
cy.login(auth.email, auth.password);
14+
cy.visit('/workspaces');
15+
});
16+
17+
it('Should be able to create a new task', () => {
18+
cy.contains('New task').click();
19+
cy.get('app-select[floatingLabel="Project"]').click();
20+
cy.get('app-option').contains('test project').click();
21+
cy.get('input[name=name]').type('Test task ' + rand);
22+
cy.get('button[type=submit]').contains('Create').click();
23+
cy.get('td').contains('test workspace').click();
24+
cy.get('td').contains('test project').click();
25+
cy.contains('Backlog').click();
26+
cy.contains('Test task ' + rand);
27+
});
28+
29+
it('Should be able to edit a task', () => {
30+
cy.get('td').contains('test workspace').click();
31+
cy.get('td').contains('test project').click();
32+
cy.contains('Backlog').click();
33+
cy.contains('.row', 'Test task ' + rand)
34+
.find('.mat-menu-trigger')
35+
.click();
36+
cy.get('button').contains('Edit task').click();
37+
cy.get('input[name=name]')
38+
.clear()
39+
.type('Test task edited ' + rand);
40+
cy.get('button[type=submit]').contains('Save changes').click();
41+
cy.contains('Test task edited ' + rand);
42+
});
43+
44+
it('Should be able to delete a task', () => {
45+
cy.get('td').contains('test workspace').click();
46+
cy.get('td').contains('test project').click();
47+
cy.contains('Backlog').click();
48+
cy.contains('.row', 'Test task edited ' + rand)
49+
.find('.mat-menu-trigger')
50+
.click();
51+
cy.get('button').contains('Delete task').click();
52+
cy.get('button').contains('Delete').click();
53+
cy.contains('Test task edited ' + rand).should('not.exist');
54+
});
55+
});
Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import auth from '../fixtures/auth.json';
22

33
describe('Workspaces tests', () => {
4+
const rand = Math.random();
5+
46
beforeEach(() => {
57
cy.logout();
68
cy.login(auth.email, auth.password);
@@ -9,29 +11,35 @@ describe('Workspaces tests', () => {
911

1012
it('Should be able to create a new workspace', () => {
1113
cy.contains('New workspace').click();
12-
cy.get('input[name=name]').type('Test workspace');
13-
cy.get('button[type=submit]').dblclick();
14-
cy.contains('Test workspace');
14+
cy.get('input[name=name]').type('Test workspace ' + rand);
15+
cy.contains('button[type=submit]', 'Save').dblclick();
16+
cy.contains('Test workspace ' + rand);
1517
});
1618

1719
it('Should not be able to create a new workspace without name', () => {
18-
cy.contains('New workspace').click();
19-
cy.get('button[type=submit]').click();
20+
cy.contains('button[type=submit]', 'New workspace').click();
21+
cy.contains('button[type=submit]', 'Save').click();
2022
cy.contains('is required');
2123
});
2224

2325
it('Should be able to edit a workspace', () => {
24-
cy.contains('tr', 'Test workspace').find('.mat-menu-trigger').click();
26+
cy.contains('tr', 'Test workspace ' + rand)
27+
.find('.mat-menu-trigger')
28+
.click();
2529
cy.contains('Edit').click();
26-
cy.get('input[name=name]').clear().type('Test workspace - renamed');
27-
cy.get('button[type=submit]').click();
28-
cy.contains('Test workspace - renamed');
30+
cy.get('input[name=name]')
31+
.clear()
32+
.type('Test workspace - renamed ' + rand);
33+
cy.contains('button[type=submit]', 'Save').click();
34+
cy.contains('Test workspace - renamed ' + rand);
2935
});
3036

3137
it('Should be able to delete a workspace', () => {
32-
cy.contains('tr', 'Test workspace - renamed').find('.mat-menu-trigger').click();
38+
cy.contains('tr', 'Test workspace - renamed ' + rand)
39+
.find('.mat-menu-trigger')
40+
.click();
3341
cy.contains('Delete').click();
3442
cy.get('.mat-dialog-container').contains('button', 'Delete').click();
35-
cy.contains('Test workspace - renamed').should('not.exist');
43+
cy.contains('Test workspace - renamed ' + rand).should('not.exist');
3644
});
3745
});

cypress/support/commands.ts

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
declare namespace Cypress {
2-
interface Chainable<Subject = any> {
3-
login(email: string, password: string): typeof login;
4-
logout(): typeof logout;
5-
createWorkspace(name: string): typeof createWorkspace;
6-
createProject(name: string): typeof createProject;
7-
deleteProject(id: number): typeof deleteProject;
8-
deleteWorkspace(id: number): typeof deleteWorkspace;
9-
deleteAllProjectsAndWorkspaces(): typeof deleteAllProjectsAndWorkspaces;
10-
clearUser(email: string, password: string): typeof clearUser;
1+
import { AuthService } from '../../src/app/auth/services/auth/auth.service';
2+
3+
declare global {
4+
namespace Cypress {
5+
// eslint-disable-next-line unused-imports/no-unused-vars
6+
interface Chainable<Subject = any> {
7+
login(email: string, password: string): typeof login;
8+
logout(): typeof logout;
9+
createWorkspace(name: string): typeof createWorkspace;
10+
createProject(name: string): typeof createProject;
11+
deleteProject(id: number): typeof deleteProject;
12+
deleteWorkspace(id: number): typeof deleteWorkspace;
13+
deleteAllProjectsAndWorkspaces(): typeof deleteAllProjectsAndWorkspaces;
14+
clearUser(email: string, password: string): typeof clearUser;
15+
}
1116
}
1217
}
1318

@@ -16,7 +21,7 @@ function requestWithAuth(
1621
fn?: (response: any) => void,
1722
) {
1823
cy.getCookie('session').then((cookie) => {
19-
const cookieValue = cookie?.value;
24+
const cookieValue = cookie && cookie.value;
2025

2126
cy.request({
2227
method,
@@ -26,27 +31,26 @@ function requestWithAuth(
2631
Cookie: 'session=' + cookieValue,
2732
},
2833
}).then((res) => {
29-
fn?.(res);
34+
fn && fn(res);
3035
});
3136
});
3237
}
3338

3439
function login(email: string, password: string) {
3540
cy.session([email, password, Math.random()], () => {
36-
cy.request({
37-
method: 'POST',
38-
url: '/api/auth/login',
39-
body: { email, password },
40-
}).then(() => {
41-
localStorage.setItem('logged', 'true');
41+
cy.visit('/login');
42+
cy.window().then((win) => {
43+
const SERVICES = (win as any)['SERVICES'];
44+
const authService = SERVICES.AuthService as AuthService;
45+
authService.login({ email, password, remember: true }).subscribe();
4246
});
4347
cy.wait(2000);
4448
});
4549
}
4650

4751
function logout() {
4852
cy.getCookie('session').then((cookie) => {
49-
const cookieValue = cookie?.value;
53+
const cookieValue = cookie && cookie.value;
5054

5155
if (!cookieValue) return;
5256

@@ -56,7 +60,7 @@ function logout() {
5660
headers: {
5761
Cookie: 'session=' + cookieValue,
5862
},
59-
}).then((res) => {
63+
}).then(() => {
6064
cy.clearCookies();
6165
cy.clearLocalStorage();
6266
});

0 commit comments

Comments
 (0)