/// <reference types="jest-playwright-preset" />
/// <reference types="expect-playwright" />

import { elementExists, localHost } from './utils';

const menuSelector = '.js-editor-menu';
const headingMenuButtonSelector = '.js-heading-btn';
const linkMenuButtonSelector = '.js-insert-link-btn';
const blockquoteMenuButtonSelector = '.js-blockquote-btn';
const imageMenuButtonSelector = '.js-insert-image-btn';
const hrMenuButtonSelector = '.js-horizontal-rule-btn';

jest.setTimeout(35 * 1000);

describe('Renewal Assessments', () => {
	it('should hide menu buttons', async () => {
		await page.goto(`${localHost}/index.html`, { waitUntil: 'load' });
		await page.goto(`${localHost}/renewal-assessments.html`, { waitUntil: 'networkidle' });
		const menu = await elementExists(menuSelector);
		expect(menu).toBeTruthy();
		const headingMenuButton = await elementExists(headingMenuButtonSelector);
		expect(headingMenuButton).toBeFalsy();
		const linkMenuButton = await elementExists(linkMenuButtonSelector);
		expect(linkMenuButton).toBeFalsy();
		const blockquoteMenuButton = await elementExists(blockquoteMenuButtonSelector);
		expect(blockquoteMenuButton).toBeFalsy();
		const imageMenuButton = await elementExists(imageMenuButtonSelector);
		expect(imageMenuButton).toBeFalsy();
		const hrMenuButton = await elementExists(hrMenuButtonSelector);
		expect(hrMenuButton).toBeFalsy();
	});
});
