aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/tests/components/charts/treemap-test.js
blob: 31b838c39047d50411ce797618103039bcd3d227 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import React from 'react/addons';
import { expect } from 'chai';

import { Treemap } from '../../../src/main/js/components/charts/treemap';


let TestUtils = React.addons.TestUtils;


describe('Treemap', function () {

  it('should display', function () {
    const items = [
      { size: 10, color: '#777', label: 'SonarQube :: Server' },
      { size: 30, color: '#777', label: 'SonarQube :: Web' },
      { size: 20, color: '#777', label: 'SonarQube :: Search' }
    ];
    let chart = TestUtils.renderIntoDocument(<Treemap items={items} width={100} height={100}/>);
    expect(TestUtils.scryRenderedDOMComponentsWithClass(chart, 'treemap-cell')).to.have.length(3);
  });

});