()
| 122 | |
| 123 | it('getNodeState()', function (done) { |
| 124 | var check = function () { |
| 125 | try { |
| 126 | $laolao = $('#n1'); |
| 127 | $bomiao = $('#n2'); |
| 128 | $sumiao = $('#n3'); |
| 129 | $hongmiao = $('#n4'); |
| 130 | $tiehua = $('#n5'); |
| 131 | $heihei = $('#n6'); |
| 132 | $pangpang = $('#n7'); |
| 133 | $dandan = $('#n8'); |
| 134 | $erdan = $('#n9'); |
| 135 | $sandan = $('#n10'); |
| 136 | |
| 137 | oc.getNodeState($laolao).should.deep.equal({ 'exist': true, 'visible': true }, "laolao->self"); |
| 138 | oc.getNodeState($laolao, 'parent').should.deep.equal({ 'exist': false, 'visible': false }, "laolao->parent"); |
| 139 | oc.getNodeState($laolao, 'children').should.deep.equal({ 'exist': true, 'visible': true }, "laolao->children"); |
| 140 | oc.getNodeState($laolao, 'siblings').should.deep.equal({ 'exist': false, 'visible': false }, "laolao->siblings"); |
| 141 | |
| 142 | oc.getNodeState($bomiao).should.deep.equal({ 'exist': true, 'visible': true }, "bomiao->self"); |
| 143 | oc.getNodeState($bomiao, 'parent').should.deep.equal({ 'exist': true, 'visible': true }, "bomiao->parent"); |
| 144 | oc.getNodeState($bomiao, 'children').should.deep.equal({ 'exist': false, 'visible': false }, "bomiao->children"); |
| 145 | oc.getNodeState($bomiao, 'siblings').should.deep.equal({ 'exist': true, 'visible': true }, "bomiao->siblings"); |
| 146 | |
| 147 | oc.getNodeState($sumiao).should.deep.equal({ 'exist': true, 'visible': true }, "sumiao->self"); |
| 148 | oc.getNodeState($sumiao, 'parent').should.deep.equal({ 'exist': true, 'visible': true }, "sumiao->parent"); |
| 149 | oc.getNodeState($sumiao, 'children').should.deep.equal({ 'exist': true, 'visible': false }, "sumiao->children"); |
| 150 | oc.getNodeState($sumiao, 'siblings').should.deep.equal({ 'exist': true, 'visible': true }, "sumiao->siblings"); |
| 151 | |
| 152 | oc.getNodeState($tiehua).should.deep.equal({ 'exist': true, 'visible': false }, "tiehua->self"); |
| 153 | oc.getNodeState($tiehua, 'parent').should.deep.equal({ 'exist': true, 'visible': true }, "tiehua->parent"); |
| 154 | oc.getNodeState($tiehua, 'children').should.deep.equal({ 'exist': true, 'visible': false }, "tiehua->children"); |
| 155 | oc.getNodeState($tiehua, 'siblings').should.deep.equal({ 'exist': true, 'visible': false }, "tiehua->siblings"); |
| 156 | |
| 157 | oc.getNodeState($heihei).should.deep.equal({ 'exist': true, 'visible': false }, "heihei->self"); |
| 158 | oc.getNodeState($heihei, 'parent').should.deep.equal({ 'exist': true, 'visible': true }, "heihei->parent"); |
| 159 | oc.getNodeState($heihei, 'children').should.deep.equal({ 'exist': true, 'visible': false }, "heihei->children"); |
| 160 | oc.getNodeState($heihei, 'siblings').should.deep.equal({ 'exist': true, 'visible': false }, "heihei->siblings"); |
| 161 | |
| 162 | oc.getNodeState($pangpang).should.deep.equal({ 'exist': true, 'visible': false }, "pangpang->self"); |
| 163 | oc.getNodeState($pangpang, 'parent').should.deep.equal({ 'exist': true, 'visible': true }, "pangpang->parent"); |
| 164 | oc.getNodeState($pangpang, 'children').should.deep.equal({ 'exist': true, 'visible': false }, "pangpang->children"); |
| 165 | oc.getNodeState($pangpang, 'siblings').should.deep.equal({ 'exist': true, 'visible': false }, "pangpang->siblings"); |
| 166 | |
| 167 | oc.getNodeState($dandan).should.deep.equal({ 'exist': true, 'visible': false }, "dandan->self"); |
| 168 | oc.getNodeState($dandan, 'parent').should.deep.equal({ 'exist': true, 'visible': false }, "dandan->parent"); |
| 169 | oc.getNodeState($dandan, 'children').should.deep.equal({ 'exist': false, 'visible': false }, "dandan->children"); |
| 170 | oc.getNodeState($dandan, 'siblings').should.deep.equal({ 'exist': false, 'visible': false }, "dandan->siblings"); |
| 171 | |
| 172 | done(); |
| 173 | } catch(err) { |
| 174 | done(err); |
| 175 | } |
| 176 | }; |
| 177 | if (typeof MutationObserver !== 'undefined') { |
| 178 | oc.init({ 'visibleLevel': 2, 'verticalLevel': 3 }).$chart.one('init.orgchart', check); |
| 179 | } else { |
nothing calls this directly
no outgoing calls
no test coverage detected