Skip to content

Commit 58eb88c

Browse files
committed
Test cases updated for non admin user
Requested by @ckarande #143
1 parent 07f4193 commit 58eb88c

File tree

6 files changed

+15
-51
lines changed

6 files changed

+15
-51
lines changed

test/e2e/integration/allocations_spec.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,21 @@ describe('/allocations behaviour', () => {
1818
cy.url().should('include', 'login')
1919
})
2020

21-
it('Should be accesible if the user is an admin', () => {
22-
cy.adminSignIn()
23-
cy.visitPage('/allocations/1')
24-
cy.url().should('include', 'allocations')
25-
})
26-
27-
it('Should be accesible if the user is not an admin', () => {
21+
it('Should be accesible for a logged user', () => {
2822
cy.userSignIn()
2923
cy.visitPage('/allocations/1')
3024
cy.url().should('include', 'allocations')
3125
})
3226

3327
it('Should be an input', () => {
34-
cy.adminSignIn()
28+
cy.userSignIn()
3529
cy.visitPage('/allocations/1')
3630
cy.get('input[name="threshold"]')
3731
})
3832

3933
it('Should redirect the user', () => {
4034
const threshold = 2
41-
cy.adminSignIn()
35+
cy.userSignIn()
4236
cy.visitPage('/allocations/1')
4337

4438
cy.get('input[name="threshold"]')

test/e2e/integration/contributions_spec.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@ describe('/contributions behaviour', () => {
1818
cy.url().should('include', 'login')
1919
})
2020

21-
it('Should be accesible if the user is an admin', () => {
22-
cy.adminSignIn()
23-
cy.visitPage('/contributions')
24-
cy.url().should('include', 'contributions')
25-
})
26-
27-
it('Should be accesible if the user is not an admin', () => {
21+
it('Should be accesible for a logged user', () => {
2822
cy.userSignIn()
2923
cy.visitPage('/contributions')
3024
cy.url().should('include', 'contributions')
3125
})
3226

3327
it('Should be a table with several inputs', () => {
34-
cy.adminSignIn()
28+
cy.userSignIn()
3529
cy.visitPage('/contributions')
3630
cy.get('table')
3731
.find('input')
@@ -40,7 +34,7 @@ describe('/contributions behaviour', () => {
4034

4135
it('Should input be modified', () => {
4236
const value = '12'
43-
cy.adminSignIn()
37+
cy.userSignIn()
4438
cy.visitPage('/contributions')
4539
cy.get('table')
4640
.find('input')

test/e2e/integration/dashboard_spec.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,14 @@ describe('/dashboard behaviour', () => {
1010
cy.url().should('include', 'login')
1111
})
1212

13-
it('Should be accesible if the user is an admin', () => {
14-
cy.adminSignIn()
15-
cy.visitPage('/dashboard')
16-
cy.url().should('include', 'dashboard')
17-
})
18-
19-
it('Should be accesible if the user is not an admin', () => {
13+
it('Should be accesible for a logged user', () => {
2014
cy.userSignIn()
2115
cy.visitPage('/dashboard')
2216
cy.url().should('include', 'dashboard')
2317
})
2418

2519
it('Should display information', () => {
26-
cy.adminSignIn()
20+
cy.userSignIn()
2721
cy.visitPage('/dashboard')
2822
cy.url().should('include', 'dashboard')
2923
cy.get('.panel')
@@ -32,7 +26,7 @@ describe('/dashboard behaviour', () => {
3226
})
3327

3428
it('Should have a link to /contributions', () => {
35-
cy.adminSignIn()
29+
cy.userSignIn()
3630
cy.visitPage('/dashboard')
3731
cy.url().should('include', 'dashboard')
3832
cy.get('.panel a')

test/e2e/integration/learn_spec.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ describe('/learn behaviour', () => {
1010
cy.url().should('include', 'login')
1111
})
1212

13-
it('Should be accesible if the user is an admin', () => {
14-
cy.adminSignIn()
15-
cy.visitPage('/learn?url=/dashboard')
16-
cy.url().should('include', 'dashboard')
17-
})
18-
19-
it('Should be accesible if the user is not an admin', () => {
13+
it('Should be accesible for a logged user', () => {
2014
cy.userSignIn()
2115
cy.visitPage('/learn?url=/dashboard')
2216
cy.url().should('include', 'dashboard')

test/e2e/integration/memos_spec.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,22 @@ describe('/memos behaviour', () => {
1818
cy.url().should('include', 'login')
1919
})
2020

21-
it('Should be accesible if the user is an admin', () => {
22-
cy.adminSignIn()
23-
cy.visitPage('/memos')
24-
cy.url().should('include', 'memos')
25-
})
26-
27-
it('Should be accesible if the user is not an admin', () => {
21+
it('Should be accesible for a logged user', () => {
2822
cy.userSignIn()
2923
cy.visitPage('/memos')
3024
cy.url().should('include', 'memos')
3125
})
3226

3327
it('Should exists a textarea', () => {
34-
cy.adminSignIn()
28+
cy.userSignIn()
3529
cy.visitPage('/memos')
3630
cy.get('textarea[name="memo"]')
3731
})
3832

3933
it('Should memo be generated', () => {
4034
const text = 'Hello World!'
4135

42-
cy.adminSignIn()
36+
cy.userSignIn()
4337
cy.visitPage('/memos')
4438
cy.get('textarea[name="memo"]')
4539
.clear()

test/e2e/integration/research_spec.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ describe('/research behaviour', () => {
1010
cy.url().should('include', 'login')
1111
})
1212

13-
it('Should be accesible if the user is an admin', () => {
14-
cy.adminSignIn()
15-
cy.visitPage('/research')
16-
cy.url().should('include', 'research')
17-
})
18-
19-
it('Should be accesible if the user is not an admin', () => {
13+
it('Should be accesible for a logged user', () => {
2014
cy.userSignIn()
2115
cy.visitPage('/research')
2216
cy.url().should('include', 'research')
@@ -31,7 +25,7 @@ describe('/research behaviour', () => {
3125

3226
it('Should have an input text as a valid stock symbol', () => {
3327
const stockSymbol = 'AAPL'
34-
cy.adminSignIn()
28+
cy.userSignIn()
3529
cy.visitPage('/research')
3630
cy.get('.form-control')
3731
.clear()

0 commit comments

Comments
 (0)