Skip to content

Commit

Permalink
Fixed sonar cloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jlucaspains committed Dec 7, 2024
1 parent c774819 commit 781b5ec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/components/RecipeList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ onMounted(async () => {
action: goToImportFromCloud,
}];
// state.title = t("pages.index.title");
state.menuOptions = [
{
svg: `<path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" />`,
Expand Down
4 changes: 2 additions & 2 deletions tests/categories.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect, Page } from '@playwright/test';
import { createCategory, createRecipe } from './helpers';
import { test, expect } from '@playwright/test';
import { createCategory } from './helpers';

test.beforeEach(async ({ page }) => {
await page.addInitScript(() => {
Expand Down
4 changes: 2 additions & 2 deletions tests/category-main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('open default category', async ({ page }) => {
await page.getByTestId('recipe-title').click();
await page.waitForTimeout(500);
await page.getByTestId('recipe-title').click();
await expect(page).toHaveURL(new RegExp(`.*/recipe/1`));
await expect(page).toHaveURL(/.*\/recipe\/1/);
});

test('displays custom category', async ({ page }) => {
Expand All @@ -45,5 +45,5 @@ test('options menu go to options', async ({ page }) => {
await page.getByTestId('topbar-options').click();
await page.getByRole('menuitem', { name: 'Options' }).click();

await expect(page).toHaveURL(new RegExp(".*/options"));
await expect(page).toHaveURL(/.*\/options/);
});
10 changes: 5 additions & 5 deletions tests/category-recipes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('open recipe', async ({ page }) => {
await createRecipe(page, 2, "recipe", 1, ["1 cup flour"], ["Preheat oven to 350 F"], false, "Category 1");
await goToCategory(page, "Category 1");
await page.getByTestId('recipe-title').click();
await expect(page).toHaveURL(new RegExp(`.*/recipe/2`));
await expect(page).toHaveURL(/.*\/recipe\/2/);
});

test('sort by title', async ({ page }) => {
Expand Down Expand Up @@ -90,7 +90,7 @@ test('options menu go to options', async ({ page }) => {
await page.getByTestId('topbar-options').click();
await page.getByRole('menuitem', { name: 'Options' }).click();

await expect(page).toHaveURL(new RegExp(".*/options"));
await expect(page).toHaveURL(/.*\/options/);
});

test('add manually', async ({ page }) => {
Expand All @@ -100,7 +100,7 @@ test('add manually', async ({ page }) => {
await page.getByTestId('add-menu-button').click();
await page.getByRole('menuitem', { name: 'Add manually' }).click();

await expect(page).toHaveURL(new RegExp(".*/recipe/0/edit"));
await expect(page).toHaveURL(/.*\/recipe\/0\/edit/);
expect(await page.getByLabel('Category').inputValue()).toBe("1");
});

Expand All @@ -111,7 +111,7 @@ test('import from website', async ({ page }) => {
await page.getByTestId('add-menu-button').click();
await page.getByRole('menuitem', { name: 'Import from website' }).click();

await expect(page).toHaveURL(new RegExp(/.*\/recipe\/0\/edit\?importFromUrl=1/));
await expect(page).toHaveURL(/.*\/recipe\/0\/edit\?importFromUrl=1/);
});

test('import from backup', async ({ page }) => {
Expand All @@ -121,7 +121,7 @@ test('import from backup', async ({ page }) => {
await page.getByTestId('add-menu-button').click();
await page.getByRole('menuitem', { name: 'Import from backup file' }).click();

await expect(page).toHaveURL(new RegExp(".*/import-backup"));
await expect(page).toHaveURL(/.*\/import-backup/);
});


Expand Down

0 comments on commit 781b5ec

Please sign in to comment.