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

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


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);
  });

});