|
| 1 | +import {readDoc, assert, find} from './../../../util.js'; |
| 2 | + |
| 3 | +/** @test {ClassDocBuilder} */ |
| 4 | +describe('TestClassPropertyDefinition:', ()=> { |
| 5 | + const doc = readDoc('class/src/ClassProperty/Definition.js~TestClassPropertyDefinition.html'); |
| 6 | + |
| 7 | + /** @test {ClassDocBuilder#_buildClassDoc} */ |
| 8 | + describe('in summary', ()=>{ |
| 9 | + it('has static member', ()=>{ |
| 10 | + find(doc, '[data-ice="staticMemberSummary"]', (doc)=>{ |
| 11 | + find(doc, 'table[data-ice="summary"]:nth-of-type(1)', (doc)=>{ |
| 12 | + assert.includes(doc, '[data-ice="target"]:nth-of-type(1)', 'public static p1: number this is static p1.'); |
| 13 | + assert.includes(doc, '[data-ice="target"]:nth-of-type(1) [data-ice="name"] a', 'class/src/ClassProperty/Definition.js~TestClassPropertyDefinition.html#static-member-p1', 'href'); |
| 14 | + }); |
| 15 | + }); |
| 16 | + }); |
| 17 | + |
| 18 | + it('has member.', ()=>{ |
| 19 | + find(doc, '[data-ice="memberSummary"]', (doc)=>{ |
| 20 | + find(doc, 'table[data-ice="summary"]:nth-of-type(1)', (doc)=> { |
| 21 | + assert.includes(doc, '[data-ice="target"]:nth-of-type(1)', 'public p1: number this is p1.'); |
| 22 | + assert.includes(doc, '[data-ice="target"]:nth-of-type(1) [data-ice="name"] a', 'class/src/ClassProperty/Definition.js~TestClassPropertyDefinition.html#instance-member-p1', 'href'); |
| 23 | + }); |
| 24 | + }); |
| 25 | + }); |
| 26 | + }); |
| 27 | + |
| 28 | + /** @test {ClassDocBuilder#_buildClassDoc} */ |
| 29 | + describe('in detail', ()=>{ |
| 30 | + it('has static member.', ()=>{ |
| 31 | + find(doc, '[data-ice="staticMemberDetails"]', (doc)=>{ |
| 32 | + find(doc, '[data-ice="detail"]:nth-of-type(1)', (doc)=>{ |
| 33 | + assert.includes(doc, '#static-member-p1', 'public static p1: number'); |
| 34 | + assert.includes(doc, '[data-ice="description"]', 'this is static p1.'); |
| 35 | + }); |
| 36 | + }); |
| 37 | + }); |
| 38 | + |
| 39 | + it('has member.', ()=>{ |
| 40 | + find(doc, '[data-ice="memberDetails"]', (doc)=>{ |
| 41 | + find(doc, '[data-ice="detail"]:nth-of-type(1)', (doc)=>{ |
| 42 | + assert.includes(doc, '#instance-member-p1', 'public p1: number'); |
| 43 | + assert.includes(doc, '#instance-member-p1 + [data-ice="description"]', 'this is p1.'); |
| 44 | + }); |
| 45 | + }); |
| 46 | + }); |
| 47 | + }); |
| 48 | +}); |
0 commit comments