Passed
Push — develop ( acc51d...b423f4 )
by Bastien
01:55
created

content_account.js ➔ ???   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 75
Code Lines 43

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 43
nc 1
dl 0
loc 75
rs 8.8478
c 0
b 0
f 0
nop 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A content_account.js ➔ ... ➔ ??? 0 4 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
describe('content :: account', () => {
2
  before(() => {
3
    cy.resetDB()
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
4
    cy.setupBaseDB()
5
  })
6
7
  beforeEach(() => {
8
    cy.login('users')
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
9
    cy.visit('/ui/account')
10
  })
11
12
  it('content :: account exist', () => {
13
    cy.get('.account__title').should('be.visible')
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
14
    cy.get('.userinfo').should('be.visible')
15
    cy.get('.account__userpreference').should('be.visible')
16
  })
17
  it('content :: account > resume', () => {
18
    //        account__userinformation
19
    cy.get('.userinfo').should('be.visible')
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
20
    cy.get('.userinfo__name').should('be.visible')
21
    cy.get('.userinfo__email').should('be.visible')
22
    cy.get('.userinfo__avatar > img').should('be.visible')
23
  })
24
  it('content :: account > menu', () => {
25
    //        account userpreference menu
26
    cy.get('.menusubcomponent__list').should('be.visible')
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
27
    cy.get(':nth-child(1) > .menusubcomponent__list__item__link').should('be.visible')
28
    cy.get(':nth-child(2) > .menusubcomponent__list__item__link').should('be.visible')
29
    cy.get(':nth-child(3) > .menusubcomponent__list__item__link').should('be.visible')
30
    //        @philippe 26/09/2018 timezone deactivated
31
    //        cy.get(':nth-child(4) > .menusubcomponent__list__item__link').should('be.visible')
32
  })
33
  it('content :: account > profile ', () => {
34
    //        account userpreference profile
35
    cy.get(':nth-child(1) > .menusubcomponent__list__item__link').click()
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
36
    cy.get('.personaldata__sectiontitle').should('be.visible')
37
    cy.get('.personaldata__form div:nth-child(1) > .personaldata__form__txtinput').should('be.visible')
38
    cy.get('.personaldata__form div:nth-child(1) > .personaldata__form__txtinput').should('have.attr', 'placeholder')
39
    cy.get('.personaldata__form div:nth-child(3) > .personaldata__form__txtinput.withAdminMsg').should('be.visible')
40
    cy.get('.personaldata__form div:nth-child(3) > .personaldata__form__txtinput.withAdminMsg').should('have.attr', 'placeholder')
41
    cy.get('.personaldata__form div:nth-child(4) > .personaldata__form__txtinput.checkPassword').should('be.visible')
42
    cy.get('.personaldata__form div:nth-child(4) > .personaldata__form__txtinput.checkPassword').should('have.attr', 'placeholder')
43
    cy.get('.personaldata__form .personaldata__form__button').should('be.visible')
44
    cy.get('.personaldata__form .personaldata__form__button').should('have.attr', 'type', 'button')
45
  })
46
  it('content :: account > password ', () => {
47
    //        account userpreference password
48
    cy.get(':nth-child(3) > .menusubcomponent__list__item__link').click()
0 ignored issues
show
Bug introduced by
The variable cy seems to be never declared. If this is a global, consider adding a /** global: cy */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
49
    cy.get('.personaldata__sectiontitle').should('be.visible')
50
    cy.get('.mr-5 div:nth-child(1) > .personaldata__form__txtinput').should('be.visible')
51
    cy.get('.mr-5 div:nth-child(1) > .personaldata__form__txtinput').should('have.attr', 'placeholder')
52
    cy.get('.mr-5 div:nth-child(2) > .personaldata__form__txtinput').should('be.visible')
53
    cy.get('.mr-5 div:nth-child(2) > .personaldata__form__txtinput').should('have.attr', 'placeholder')
54
    cy.get('.mr-5 div:nth-child(3) > .personaldata__form__txtinput').should('be.visible')
55
    cy.get('.mr-5 div:nth-child(3) > .personaldata__form__txtinput').should('have.attr', 'placeholder')
56
    cy.get('.mr-5 .personaldata__form__button').should('be.visible')
57
    cy.get('.mr-5 .personaldata__form__button').should('have.attr', 'type', 'button')
58
  })
59
  //    @philippe 26/09/2018 timezone deactivated
60
  //    it('content :: account > timezone ', function() {
61
  //        // account userpreference timezone
62
  //        cy.get(':nth-child(4) > .menusubcomponent__list__item__link').click()
63
  //        cy.get('.timezone__title').should('be.visible')
64
  //        cy.get('#react-select-2--value .Select-placeholder').should('be.visible')
65
  //    })
66
  //    Not in Tracim_V2.0*/
67
  //    it('content :: account > calendar ', function() {
68
  //        // account userpreference personal calendar
69
  //        cy.get(':nth-child(7) > .menusubcomponent__list__item__link').click()
70
  //        cy.get('.account__userpreference__setting__calendar').should('be.visible')
71
  //        cy.get('.calendar__title.subTitle').should('be.visible')
72
  //        cy.get('.calendar__title').should('be.visible')
73
  //        cy.get('.calendar__link').should('be.visible')
74
  //    })
75
})
76