Skip to content

Commit

Permalink
test: add test coverage for trait show body
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdabbs committed Nov 7, 2023
1 parent 0adf513 commit a2778f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion packages/viewer/cypress/e2e/space.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import { deduce, setup } from '../support'

beforeEach(setup)

function clickTraitFor(name: string) {
cy.get('.related-traits')
.contains(name)
.closest('tr')
.find('.bi-check')
.click()
}

it('links to properties', () => {
cy.visit('spaces/S000004/properties')
deduce()
Expand All @@ -15,7 +23,7 @@ it('links to traits', () => {
cy.visit('spaces/S000004/properties')
deduce()

cy.contains('Semiregular').closest('tr').find('.bi-check').click()
clickTraitFor('Semiregular')

cy.location('pathname').should('eq', '/spaces/S000004/properties/P000010')
})
Expand All @@ -30,3 +38,11 @@ it('filters traits', () => {
.first()
.should('have.text', '16 Compact ')
})

it('displays trait descriptions', () => {
cy.visit('spaces/S000001')

clickTraitFor('Discrete')

cy.contains('By definition of discrete')
})
2 changes: 1 addition & 1 deletion packages/viewer/cypress/fixtures/main.min.json
Original file line number Diff line number Diff line change
Expand Up @@ -6088,7 +6088,7 @@
"refs": [

],
"description": "-"
"description": "By definition of discrete"
},
{
"uid": "T024776",
Expand Down

0 comments on commit a2778f7

Please sign in to comment.