Skip to content

Commit 78ab5bf

Browse files
show trait description on trait, not space (#76)
* show trait description on trait, not space * test: add test coverage for trait show body --------- Co-authored-by: James Dabbs <[email protected]>
1 parent 8a4bd46 commit 78ab5bf

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

packages/viewer/cypress/e2e/space.spec.ts

+17-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ import { deduce, setup } from '../support'
22

33
beforeEach(setup)
44

5+
function clickTraitFor(name: string) {
6+
cy.get('.related-traits')
7+
.contains(name)
8+
.closest('tr')
9+
.find('.bi-check')
10+
.click()
11+
}
12+
513
it('links to properties', () => {
614
cy.visit('spaces/S000004/properties')
715
deduce()
@@ -15,7 +23,7 @@ it('links to traits', () => {
1523
cy.visit('spaces/S000004/properties')
1624
deduce()
1725

18-
cy.contains('Semiregular').closest('tr').find('.bi-check').click()
26+
clickTraitFor('Semiregular')
1927

2028
cy.location('pathname').should('eq', '/spaces/S000004/properties/P000010')
2129
})
@@ -30,3 +38,11 @@ it('filters traits', () => {
3038
.first()
3139
.should('have.text', '16 Compact ')
3240
})
41+
42+
it('displays trait descriptions', () => {
43+
cy.visit('spaces/S000001')
44+
45+
clickTraitFor('Discrete')
46+
47+
cy.contains('By definition of discrete')
48+
})

packages/viewer/cypress/fixtures/main.min.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6088,7 +6088,7 @@
60886088
"refs": [
60896089

60906090
],
6091-
"description": "-"
6091+
"description": "By definition of discrete"
60926092
},
60936093
{
60946094
"uid": "T024776",

packages/viewer/src/components/Traits/Show.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
<Proof {space} {...proof} />
5151
{:else if meta}
5252
<section class="description">
53-
<Typeset body={space.description} />
53+
<Typeset body={meta.description} />
5454
</section>
55-
55+
<h3>References</h3>
5656
<References references={meta.refs} />
5757
{/if}
5858
{:catch}

0 commit comments

Comments
 (0)