-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devel' of https://github.com/fga-gpp-mds/Falko-2017.2-F…
…rontEnd into us23_planejar_sprint
- Loading branch information
Showing
6 changed files
with
329 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"auth_token": "token123", | ||
"user": { | ||
"id": 1, | ||
"name": "Carla", | ||
"email": "[email protected]" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "Owla", | ||
"description": "Improving classes", | ||
"user_id": 2 | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Falko", | ||
"description": "Agile Projects Manager", | ||
"user_id": 2 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"id": 1, | ||
"name": "Carla", | ||
"email": "[email protected]", | ||
"github": "carlaGit", | ||
"access_token": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,7 @@ describe('Authorization tests', function (){ | |
method: 'POST', | ||
url: '/authenticate', | ||
status: 200, | ||
response: { | ||
'auth_token': 'token123', | ||
'user': { | ||
'id': 1, | ||
'name': 'Carla', | ||
'email': '[email protected]' | ||
} | ||
} | ||
response: 'fixture:login.json' | ||
}).as('login') | ||
}) | ||
|
||
|
@@ -94,14 +87,7 @@ describe('Authorization tests', function (){ | |
method: 'POST', | ||
url: '/users', | ||
status: 200, | ||
response: { | ||
'auth_token': 'token123', | ||
'user': { | ||
'id': 1, | ||
'name': 'Carla', | ||
'email': '[email protected]' | ||
} | ||
} | ||
response: 'fixture:login.json' | ||
}).as('register') | ||
|
||
cy.get('#pills-register-tab').click() | ||
|
@@ -160,4 +146,24 @@ describe('Authorization tests', function (){ | |
|
||
cy.url().should('eq', 'http://localhost:8080/#/') | ||
}) | ||
|
||
it('should logout user', function(){ | ||
cy.get('form').within(function () { | ||
cy.get('input:first').eq(0).should('have.attr', 'placeholder', 'Email') | ||
.type('[email protected]').should('have.value', '[email protected]') | ||
|
||
cy.get('input:last').eq(0).should('have.attr', 'placeholder', 'Password') | ||
.type('123456789').should('have.value', '123456789') | ||
}) | ||
|
||
cy.get('.falko-button').eq(0).click() | ||
|
||
cy.get('#noProjects') | ||
|
||
cy.get('.navbar').within(function(){ | ||
cy.get('#logout').click() | ||
}) | ||
|
||
cy.url().should('eq', 'http://localhost:8080/#/') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,7 @@ describe('Projects tests', function(){ | |
method: 'POST', | ||
url: '/authenticate', | ||
status: 200, | ||
response: { | ||
'auth_token': 'token123', | ||
'user': { | ||
'id': 1, | ||
'name': 'Carla', | ||
'email': '[email protected]' | ||
} | ||
} | ||
response: 'fixture:login.json' | ||
}).as('login') | ||
|
||
cy.get('form').within(function () { | ||
|
@@ -35,20 +28,7 @@ describe('Projects tests', function(){ | |
method: 'GET', | ||
url: '/users\/1/projects', | ||
status: 200, | ||
response: [ | ||
{ | ||
"id": 1, | ||
"name": "Owla", | ||
"description": "Improving classes", | ||
"user_id": 2, | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Falko", | ||
"description": "Agile Projects Manager", | ||
"user_id": 2, | ||
} | ||
] | ||
response: 'fixture:projects.json' | ||
}).as('getProjects') | ||
}) | ||
|
||
|
@@ -143,5 +123,150 @@ describe('Projects tests', function(){ | |
cy.get('.card-text').eq(11).contains('New Project Description') | ||
}) | ||
}) | ||
|
||
it('should cancel add project process', function () { | ||
|
||
login() | ||
|
||
cy.get('#addButton').contains('Add a Project').click() | ||
|
||
cy.wait(200) | ||
|
||
cy.get('.modal-footer').eq(0).within(function () { | ||
cy.get('.falko-button-grey').contains('Close').click() | ||
}) | ||
|
||
cy.get('.card-header').eq(0).contains('Owla') | ||
cy.get('.card-header').eq(1).contains('Falko') | ||
}) | ||
|
||
it('should edit a project', function(){ | ||
login() | ||
|
||
cy.route({ | ||
method: 'GET', | ||
url: '/projects\/2', | ||
status: 200, | ||
response: | ||
{ | ||
"description":"Agile Projects Manager" , | ||
"github_slug": "fga-gpp-mds/owla", | ||
"id":2, | ||
"is_project_from_github":true, | ||
"is_scoring":false, | ||
"name":"Falko", | ||
"user_id":1, | ||
} | ||
}).as('getProject') | ||
|
||
cy.get('.card-body').eq(1).click() | ||
|
||
cy.wait('@getProject') | ||
|
||
cy.get('.card-title').contains('Falko') | ||
cy.get('.card-text').contains('Agile Projects Manager') | ||
|
||
cy.get('#editbutton').eq(0).click() | ||
cy.get('.modal-header').contains('Edit Project') | ||
|
||
cy.get('input').eq(1).type(' plus').should('have.value','Falko plus') | ||
cy.get('input').eq(2).type(' plus').should('have.value','Agile Projects Manager plus') | ||
|
||
cy.get('.v-switch-label').contains('off') | ||
|
||
cy.route({ | ||
method: 'PUT', | ||
url: '/projects\/2', | ||
status: 200, | ||
response: | ||
{ | ||
"description":"AAgile Projects Manager plus" , | ||
"github_slug": "fga-gpp-mds/owla", | ||
"id":2, | ||
"is_project_from_github":true, | ||
"is_scoring":false, | ||
"name":"Falko plus", | ||
"user_id":1, | ||
}, | ||
}).as('updateProject') | ||
|
||
cy.route({ | ||
method: 'GET', | ||
url: '/projects\/2', | ||
status: 200, | ||
response: | ||
{ | ||
"description":"Agile Projects Manager plus" , | ||
"github_slug": "fga-gpp-mds/owla", | ||
"id":2, | ||
"is_project_from_github":true, | ||
"is_scoring":false, | ||
"name":"Falko plus", | ||
"user_id":1, | ||
} | ||
}).as('getProjectUp') | ||
|
||
|
||
cy.get('.modal-footer').within(function(){ | ||
cy.get('.falko-button').eq(0).contains('Save').click() | ||
}) | ||
|
||
cy.wait('@getProjectUp') | ||
|
||
cy.get('.card-title').contains('Falko plus') | ||
cy.get('.card-text').contains('Agile Projects Manager plus') | ||
}) | ||
|
||
it('should delete project', function(){ | ||
login() | ||
|
||
cy.route({ | ||
method: 'GET', | ||
url: '/projects\/1', | ||
status: 200, | ||
response: | ||
{ | ||
"description": "Agile Projects Manager", | ||
"github_slug": "fga-gpp-mds/owla", | ||
"id": 2, | ||
"is_project_from_github": true, | ||
"is_scoring": false, | ||
"name": "Falko", | ||
"user_id": 1, | ||
} | ||
}).as('getProject') | ||
|
||
cy.route({ | ||
method: 'DELETE', | ||
url: '/projects/1', | ||
status: 200, | ||
response: {} | ||
}).as('deleteProject') | ||
|
||
|
||
cy.get('.card-header').eq(0).contains('Owla').click() | ||
|
||
cy.route({ | ||
method: 'GET', | ||
url: '/users\/1/projects', | ||
status: 200, | ||
response: [{ | ||
"id": 2, | ||
"name": "Falko", | ||
"description": "Agile Projects Manager", | ||
"user_id": 2 | ||
}] | ||
}).as('getProjectsAfterDelete') | ||
|
||
cy.get('#deletebutton').contains('Delete').click() | ||
|
||
cy.wait(200) | ||
|
||
cy.get('.modal-footer').eq(1).within(function(){ | ||
cy.get('.falko-button').click() | ||
}) | ||
|
||
cy.get('.card-header').contains('Falko') | ||
}) | ||
}) | ||
|
Oops, something went wrong.