Skip to content

Commit

Permalink
add subscriptions tags relationship & replace chakra ui with mantine
Browse files Browse the repository at this point in the history
  • Loading branch information
vorant94 committed Jun 16, 2024
1 parent 4da8390 commit e2b1bdc
Show file tree
Hide file tree
Showing 24 changed files with 983 additions and 2,203 deletions.
17 changes: 9 additions & 8 deletions e2e/subscriptions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { expect, test } from '@playwright/test';
import type { RawFormValue } from '../src/form/types/raw-form-value';
import dayjs from 'dayjs';
import type { InsertSubscriptionModel } from '../src/subscriptions/models/subscription.model';

test('should create subscription', async ({ page }) => {
const formValue = {
name: 'Webstorm',
description: 'JavaScript/TypeScript IDE',
icon: 'jetbrains',
price: '10',
startedAt: '2024-03-01',
endedAt: '2024-08-01',
price: 10,
startedAt: dayjs(new Date()).subtract(2, 'month').toDate(),
endedAt: dayjs(new Date()).add(1, 'year').toDate(),
cycle: {
each: '1',
each: 1,
period: 'monthly',
},
} as const satisfies RawFormValue<InsertSubscriptionModel>;
tags: [],
} as const satisfies InsertSubscriptionModel;

await page.goto('/');
await page.getByRole('link', { name: 'subscriptions' }).click();
Expand All @@ -29,10 +30,10 @@ test('should create subscription', async ({ page }) => {
await page.getByLabel('name').fill(formValue.name);
await page.getByLabel('description').fill(formValue.description);
await page.getByLabel('icon').selectOption(formValue.icon);
await page.getByLabel('price').fill(formValue.price);
await page.getByLabel('price').fill(`${formValue.price}`);
await page.getByLabel('started at').fill(formValue.startedAt);
await page.getByLabel('ended at').fill(formValue.endedAt);
await page.getByLabel('each').fill(formValue.cycle.each);
await page.getByLabel('each').fill(`${formValue.cycle.each}`);
await page.getByLabel('period').selectOption(formValue.cycle.period);

await page.getByRole('button', { name: 'insert' }).click();
Expand Down
Loading

0 comments on commit e2b1bdc

Please sign in to comment.