package ru.otus.mobile.tests;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import ru.otus.mobile.screens.UsersScreen;
import ru.otus.mobile.util.TestAccount;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class ReservationTest extends BaseMobileTest {
    @Test
    @DisplayName("Изменение статуса резервирования подарка другого пользователя")
    void changeReservationStatus() {
        UsersScreen users = new UsersScreen();
        users.open();
        String owner = System.getProperty("reservation.owner", "user4us");
        users.openUserWithGift(owner);
        users.openFirstGift();
        boolean changed = users.toggleReservation();
        assertTrue(changed, "Reservation status was not changed");
    }

    @Override
    protected TestAccount account() {
        return TestAccount.RESERVATION;
    }
}
