import pytest
import importlib
code = importlib.import_module('tabs.evaluation')


#=================TEST SIDEBAR EVALUATION ===========================
def test_sidebar_evaluation_nrt():
    assert "Button(children='Visual comparison', id='nrt-evaluation', color='link', style={'fontWeight': 'bold'}" in str(code.sidebar_evaluation('nrt'))

    assert "[Div(children=[Label('Variable'), Dropdown(options=[{'label': 'AOD', 'value': 'OD550_DUST'}, {'label': 'Concentration', 'value': 'SCONC_DUST'}, {'label': 'Dry deposition', 'value': 'DUST_DEPD'}" in str(code.sidebar_evaluation('nrt'))

def test_sidebar_evaluation_scores():
    assert "children='Statistics', id='scores-evaluation', color='link', style={'fontWeight': 'bold'})], className='sidebar-item')]" in str(code.sidebar_evaluation('scores'))

    assert "[Div(children=[Label('Variable'), Dropdown(options=[{'label': 'AOD', 'value': 'OD550_DUST'}, {'label': 'Concentration', 'value': 'SCONC_DUST'}" in str(code.sidebar_evaluation('scores'))

#=================TEST TAB EVALUATION ===========================
def test_tab_evaluation_nrt():
    assert "Tab(children=[Span(children=P('Visual comparison'), className='description-title'), Span(children=P('The visual comparison offers a quick overview of the quality of the forecast." in str(code.tab_evaluation(window='nrt'))

    assert "id='open-eval-timeseries')], id='loading-ts-eval-modal', fullscreen=True, fullscreen_style={'opacity': '0.5', 'zIndex': 1000})], id='evaluation-tab', className='horizontal-menu', label='Evaluation', value='evaluation-tab')" in str(code.tab_evaluation(window='nrt'))

def test_tab_evaluation_scores():
    assert "Tab(children=[Alert(children='To explore the evaluation of the forecast, please make a selection of Network, Models, Statistics, Timescale and click on APPLY.', id='alert-evaluation'" in str(code.tab_evaluation(window='scores'))

    assert "id='eval-tables', style={'padding': '1rem 0.1rem 0.1rem 1rem', 'width': '95%'})], id='evaluation-tab', className='horizontal-menu', label='Evaluation', value='evaluation-tab')" in str(code.tab_evaluation(window='scores'))
