<commit_before>/**
 * @fileoverview Test for BubbleChart.
 * @author <NAME>.
 *         FE Development Lab <<EMAIL>>
 */

'use strict';

var BubbleChart = require('../../src/js/charts/bubbleChart');
var axisDataMaker = require('../../src/js/scaleModels/axisDataMaker');
var CircleLegend = require('../../src/js/legends/circleLegend');

describe('Test for BubbleChart', function() {
    var bubbleChart, componentManager, dataProcessor, boundsMaker, scaleModel, sereisDataModel;

    beforeEach(function() {
        bubbleChart = BubbleChart.prototype;
        componentManager = jasmine.createSpyObj('componentManager', ['register']);
        dataProcessor = jasmine.createSpyObj('dataProcessor',['addDataRatiosForCoordinateType', 'isCoordinateType']);
        boundsMaker = jasmine.createSpyObj('boundsMaker', ['getDimension', 'getMinimumPixelStepForAxis',
                'registerBaseDimension', 'registerAxesData']);
        scaleModel = jasmine.createSpyObj('seriesDataModel', ['getScaleMap']);
        sereisDataModel = jasmine.createSpyObj('seriesDataModel', ['isXCountGreaterThanYCount']);

        bubbleChart.componentManager = componentManager;
        bubbleChart.dataProcessor = dataProcessor;
        bubbleChart.boundsMaker = boundsMaker;
        bubbleChart.scaleModel = scaleModel;
        bubbleChart.chartType = 'bubble';
    });

    describe('_addComponents()', function() {
        it('circleLegend.visible 옵션이 true이면 componentManager.register를 호출하여 circleLegend 컴포넌트를 생성합니다.', function() {
            spyOn(bubbleChart, '_addComponentsForAxisType');
            bubbleChart.options = {
                circleLegend: {
                    visible: true
                },
                legend: {}
            };
            bubbleChart.theme = {
                chart: {
                    fontFamily: 'Verdana'
                }
            };

            bubbleChart._addComponents('bubble');

            expect(componentManager.register).toHaveBeenCalledWith('circleLegend', CircleLegend, {
                chartType: 'bubble',
                baseFontFamily: 'Verdana'
            });
        });

        it('circleLegend.visible 옵션이 false이면 componentManager.register를 호출하지 않아, circleLegend 컴포넌트를 생성하지 않습니다.', function() {
            spyOn(bubbleChart, '_addComponentsForAxisType');
            bubbleChart.options = {
                circleLegend: {
                    visible: false
                }
            };
            bubbleChart._addComponents();

            expect(componentManager.register).not.toHaveBeenCalled();
        });
    });

    describe('_addDataRatios()', function() {
        it('add data ratio, when bubble chart', function() {
            var axisScaleMaker = jasmine.createSpyObj('axisScaleMaker', ['getLimit']);

            axisScaleMaker.getLimit.and.returnValue('calculated limit by x values');
            scaleModel.getScaleMap.and.returnValue({
                xAxis: axisScaleMaker
            });
            bubbleChart._addDataRatios();

            expect(dataProcessor.addDataRatiosForCoordinateType).toHaveBeenCalledWith('bubble', {
                x: 'calculated limit by x values'
            }, true);

        });
    });
});
<commit_msg>test: Remove test for _addDataRatios<commit_after>/**
 * @fileoverview Test for BubbleChart.
 * @author <NAME>.
 *         FE Development Lab <<EMAIL>>
 */

'use strict';

var BubbleChart = require('../../src/js/charts/bubbleChart');
var axisDataMaker = require('../../src/js/scaleModels/axisDataMaker');
var CircleLegend = require('../../src/js/legends/circleLegend');

describe('Test for BubbleChart', function() {
    var bubbleChart, componentManager, dataProcessor, boundsMaker, scaleModel, sereisDataModel;

    beforeEach(function() {
        bubbleChart = BubbleChart.prototype;
        componentManager = jasmine.createSpyObj('componentManager', ['register']);
        dataProcessor = jasmine.createSpyObj('dataProcessor',['addDataRatiosForCoordinateType', 'isCoordinateType']);
        boundsMaker = jasmine.createSpyObj('boundsMaker', ['getDimension', 'getMinimumPixelStepForAxis',
                'registerBaseDimension', 'registerAxesData']);
        scaleModel = jasmine.createSpyObj('seriesDataModel', ['getScaleMap']);
        sereisDataModel = jasmine.createSpyObj('seriesDataModel', ['isXCountGreaterThanYCount']);

        bubbleChart.componentManager = componentManager;
        bubbleChart.dataProcessor = dataProcessor;
        bubbleChart.boundsMaker = boundsMaker;
        bubbleChart.scaleModel = scaleModel;
        bubbleChart.chartType = 'bubble';
    });

    describe('_addComponents()', function() {
        it('circleLegend.visible 옵션이 true이면 componentManager.register를 호출하여 circleLegend 컴포넌트를 생성합니다.', function() {
            spyOn(bubbleChart, '_addComponentsForAxisType');
            bubbleChart.options = {
                circleLegend: {
                    visible: true
                },
                legend: {}
            };
            bubbleChart.theme = {
                chart: {
                    fontFamily: 'Verdana'
                }
            };

            bubbleChart._addComponents('bubble');

            expect(componentManager.register).toHaveBeenCalledWith('circleLegend', CircleLegend, {
                chartType: 'bubble',
                baseFontFamily: 'Verdana'
            });
        });

        it('circleLegend.visible 옵션이 false이면 componentManager.register를 호출하지 않아, circleLegend 컴포넌트를 생성하지 않습니다.', function() {
            spyOn(bubbleChart, '_addComponentsForAxisType');
            bubbleChart.options = {
                circleLegend: {
                    visible: false
                }
            };
            bubbleChart._addComponents();

            expect(componentManager.register).not.toHaveBeenCalled();
        });
    });
});

{'fraction_non_alphanumeric': 0.11711403658745084, 'fraction_numerical': 0.0, 'mean_word_length': 2.43108504398827, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3494932', 'n_tokens_mistral': 1648, 'n_tokens_neox': 1662, 'n_words': 258}