import { Locator, Page, expect } from "@playwright/test";
import { marketplaceSellerSettings } from "../../pageObjects/mp-configuration/mp-seller-settings";
import { WebAllLocators } from "../locator";

export class SellerMinimumOrderAmount {
    readonly page: Page;
    readonly locators: WebAllLocators;

    constructor(page: Page) {
        this.page = page;
        this.locators = new WebAllLocators(page);
    }

    async sellerProfileSectionGoto() {
        await this.page.goto("seller/profile");
    }

    async sellerMinimumOrderAmount(minimumAmount: Number) {
        const SellerSettings = new marketplaceSellerSettings(this.page);

        await this.sellerProfileSectionGoto();

        await this.locators.sellerMinimumOrderAmount.fill(
            minimumAmount.toString()
        );
        await this.locators.sellerProfileSaveButton.click();

        await expect(this.locators.sellerprofileUpdateToast).toBeVisible();
    }
}
