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

  A

Complexity

Conditions 1
Paths 1

Size

Total Lines 33
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 29
nc 1
dl 0
loc 33
rs 9.184
c 0
b 0
f 0
nop 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A operation_allcontent_delete_thread.js ➔ ... ➔ ??? 0 13 1
1
describe('operation :: workspace > delete > thread', function () {
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(function () {
8
    cy.login('administrators')
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
  })
10
  it('all content > delete thread', function () {
11
    cy.visit('/ui/workspaces/1/dashboard')
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...
12
    cy.get('.dashboard__workspace__detail').should('be.visible')
13
    cy.get('.dashboard__calltoaction .fa-comments-o').should('be.visible')
14
    cy.get('.dashboard__calltoaction .fa-comments-o').click()
15
    var titre1 = 'createthread'
16
    cy.get('.cardPopup__container .createcontent .createcontent__contentname').should('be.visible')
17
    cy.get('.cardPopup__container .createcontent .createcontent__form__input').should('have.attr', 'placeholder')
18
    cy.get('.cardPopup__container .createcontent .createcontent__form__input').type(titre1)
19
    cy.get('.cardPopup__container .createcontent .createcontent__form__input').should('have.attr', 'value', titre1)
20
    cy.get('.cardPopup__container .createcontent button.createcontent__form__button').click()
21
    cy.get('.cardPopup__container .createcontent  .createcontent__contentname').should('not.be.visible')
22
    cy.get('.thread.visible').should('be.visible')
23
    cy.get('.thread.visible .wsContentGeneric__header__title').contains(titre1)
24
    cy.get('.thread.visible .thread__contentpage__header__close').click()
25
    cy.get('.thread.visible').should('not.be.visible')
26
    cy.visit('/ui/workspaces/1/contents')
27
    cy.get('.pageTitleGeneric__title__icon').should('be.visible')
28
    var titre1 = 'createthread'
0 ignored issues
show
Comprehensibility Naming Best Practice introduced by
The variable titre1 already seems to be declared on line 15. Consider using another variable name or omitting the var keyword.

This check looks for variables that are declared in multiple lines. There may be several reasons for this.

In the simplest case the variable name was reused by mistake. This may lead to very hard to locate bugs.

If you want to reuse a variable for another purpose, consider declaring it at or near the top of your function and just assigning to it subsequently so it is always declared.

Loading history...
29
    cy.get('.content__name').each(($elm) => {
30
      cy.wrap($elm).invoke('text').then((text) => {
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...
31
        if (text === titre1) {
32
          cy.get('.content__name').contains(titre1).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...
33
          cy.get('.thread.visible').should('be.visible')
34
          cy.get('.thread.visible .wsContentGeneric__header__title').contains(titre1)
35
          cy.get('.thread.visible .align-items-center button:nth-child(2)').click()
36
          cy.get('.thread.visible .timeline__info__btnrestore').should('be.visible')
37
          cy.get('.thread.visible .thread__contentpage__header__close').click()
38
          cy.get('.thread.visible').should('not.be.visible')
39
        }
40
      })
41
    })
42
  })
43
})
44