diff --git a/src/components/Editor/Toolbar/MicroBubbleMenu.tsx b/src/components/Editor/Toolbar/MicroBubbleMenu.tsx index 06883fb9..bca78461 100644 --- a/src/components/Editor/Toolbar/MicroBubbleMenu.tsx +++ b/src/components/Editor/Toolbar/MicroBubbleMenu.tsx @@ -20,7 +20,7 @@ export const MicroBubbleMenu = (props: MicroBubbleMenuProps) => { const isActive = (name: string, attributes?: Record) => createEditorTransaction( - // biome-ignore lint/suspicious/noExplicitAny: tiptap 2.8.0 typing issue + // biome-ignore lint/suspicious/noExplicitAny: tiptap 2.8.0 typing () => props.editor as any, (editor) => editor?.isActive(name, attributes) ) diff --git a/tests/3-auth-drafts-actions.spec.ts b/tests/3-auth-drafts-actions.spec.ts index c9b592bc..86d7fa2f 100644 --- a/tests/3-auth-drafts-actions.spec.ts +++ b/tests/3-auth-drafts-actions.spec.ts @@ -72,7 +72,7 @@ test.beforeEach(async ({ page }) => { await page.getByRole('button', { name: 'Войти' }).click() }) -test.describe('*****Undone***** Drafts - article', () => { +test.describe('Create new draft', () => { test('Open /edit/new', async ({ page }) => { await page.goto('/edit/new') await expect(page).toHaveTitle('Выберите тип публикации') @@ -84,28 +84,27 @@ test('Create article', async ({ page }) => { await page.locator('li').filter({ hasText: 'статья' }).locator('img').click() }) -/* - -test('Check Draft', async ({ page }) => {}); - test('Drafts - create literature', async ({ page }) => { - await page.getByRole('button', { name: 'Т.Р' }).click(); - await page.getByRole('link', { name: 'Черновики' }).click(); - await page.getByRole('link', { name: 'Создать публикацию' }).click(); - await page.locator('li').filter({ hasText: /^литература$/ }).locator('img').click(); -}); + await page.getByRole('button', { name: 'Т.Р' }).click() + await page.getByRole('link', { name: 'Черновики' }).click() + await page.getByRole('link', { name: 'Создать публикацию' }).click() + // biome-ignore lint/performance/useTopLevelRegex: + await page + .locator('li') + .filter({ hasText: /^литература$/ }) + .locator('img') + .click() +}) -*/ - -/* test('Drafts - create images', async ({ page }) => { - await page.getByRole('button', { name: 'Т.Р' }).click(); - await page.getByRole('link', { name: 'Черновики' }).click(); - await page.getByRole('link', { name: 'Создать публикацию' }).click(); - await page.locator('li').filter({ hasText: 'изображения' }).locator('img').click(); - Fill the form - Save - Check is it created -}); */ +test('Drafts - create images', async ({ page }) => { + await page.getByRole('button', { name: 'Т.Р' }).click() + await page.getByRole('link', { name: 'Черновики' }).click() + await page.getByRole('link', { name: 'Создать публикацию' }).click() + await page.locator('li').filter({ hasText: 'изображения' }).locator('img').click() + // Fill the form + // Save + // Check is it created +}) test('Drafts - create music', async ({ page }) => { await page.getByRole('button', { name: 'Т.Р.' }).click() @@ -117,17 +116,19 @@ test('Drafts - create music', async ({ page }) => { // TODO: Check is it created }) -/* test('Drafts - create video', async ({ page }) => { - await page.getByRole('button', { name: 'Т.Р' }).click(); - await page.getByRole('link', { name: 'Черновики' }).click(); - await page.getByRole('link', { name: 'Создать публикацию' }).click(); - await page.locator('li').filter({ hasText: 'видео' }).locator('img').click(); - Fill the form - Save - Check is it created -}); */ +test('Drafts - create video', async ({ page }) => { + await page.getByRole('button', { name: 'Т.Р' }).click() + await page.getByRole('link', { name: 'Черновики' }).click() + await page.getByRole('link', { name: 'Создать публикацию' }).click() + await page.locator('li').filter({ hasText: 'видео' }).locator('img').click() + // Fill the form + // Save + // Check is it created +}) -/* test('Post topic', async ({ page }) => { - Open Draft - Post -});*/ +test('Post topic', async ({ page }) => { + await page.getByRole('button', { name: 'Т.Р.' }).click() + await page.getByRole('link', { name: 'Черновики' }).click() + await page.getByRole('link', { name: 'Создать публикацию' }).click() + // Post +})