import { test, expect } from '../../fixtures/index';
import { InboxPage } from '../../pom/inbox/inbox.page';
import { LoginPage } from '../../pom/login.page';

test.describe("UI case for inbox tests", async () => {
    let loginPage: LoginPage;
    let inboxPage: InboxPage;

    test.beforeEach(async ({ page, conf }) => {
        loginPage = new LoginPage(page);
        inboxPage = new InboxPage(page);

        await loginPage.open();
        await loginPage.login(conf.data.username, conf.data.password);
        await inboxPage.open();
    });

    test("INBOX_001 -  Verify UI when empty state", {
        tag: ["@INBOX_001", "@inbox", "@ui"]
    }, async ({ conf }) => {
        await expect(inboxPage.dashboardLoc.root).toMatchAriaSnapshot(inboxPage.inboxSnapshot.emptyInbox);
    })

    test("INBOX_002 - Verify UI when have inbox", {
        tag: ["@INBOX_002", "@inbox", "@ui"]
    }, async () => {
        await expect(inboxPage.dashboardLoc.root).toMatchAriaSnapshot(inboxPage.inboxSnapshot.haveInboxHeadingColumn);
    })
})