import numpy as np

from src.repositories.battleList import locators


def test_battle_list_icon_allows_minor_client_rendering_differences(mocker):
    screenshot = np.zeros((10, 10), dtype=np.uint8)
    locate = mocker.patch.object(locators, 'locate', return_value=(1, 2, 3, 4))

    assert locators.getBattleListIconPosition(screenshot) == (1, 2, 3, 4)
    locate.assert_called_once_with(
        screenshot,
        locators.images['icons']['ng_battleList'],
        confidence=0.8,
    )
