{"size": 1239, "ext": "js", "max_stars_repo_path": "test/components/WeatherForecastItem.test.js", "max_stars_repo_name": "eemp/mozaik-ext-weather", "max_stars_repo_stars_event_min_datetime": "2015-02-23T06:43:40.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-13T08:15:16.000Z", "max_issues_repo_path": "test/components/WeatherForecastItem.test.js", "max_issues_repo_name": "eemp/mozaik-ext-weather", "max_issues_repo_issues_event_min_datetime": "2015-02-27T08:43:10.000Z", "max_issues_repo_issues_event_max_datetime": "2020-07-24T15:56:59.000Z", "max_forks_repo_path": "test/components/WeatherForecastItem.test.js", "max_forks_repo_name": "eemp/mozaik-ext-weather", "max_forks_repo_forks_event_min_datetime": "2015-02-24T11:59:35.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-07T02:36:16.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 28, "avg_line_length": 36.4411764706, "max_line_length": 100, "alphanum_fraction": 0.6820016142}
import test                from 'ava';
import React               from 'react'; // eslint-disable-line no-unused-vars
import { shallow }         from 'enzyme';
import WeatherForecastItem from '../../src/components/WeatherForecastItem.jsx';


const  temp = {
    min: 275,
    max: 285
};

const weatherItem = {
    id:          800,
    description: 'test description'
};


test('should display weather description and icon', t => {
    const wrapper = shallow(<WeatherForecastItem weather={[weatherItem]} temp={temp} />);

    t.is(wrapper.find('.weather__weather__forecast__item__description').length, 1);
    t.is(wrapper.find('.weather__weather__forecast__item__description').text(), 'test description');
    t.is(wrapper.find('.weather__icon--clear-sky').length, 1);
});

test('should render min and max temp', t => {
    const wrapper = shallow(<WeatherForecastItem weather={[weatherItem]} temp={temp} />);

    t.is(wrapper.find('.weather__weather__forecast__item__min').length, 1);
    t.is(wrapper.find('.weather__weather__forecast__item__min').text(), 'min.2°C');
    t.is(wrapper.find('.weather__weather__forecast__item__max').length, 1);
    t.is(wrapper.find('.weather__weather__forecast__item__max').text(), 'max.12°C');
});
