Skip to content

Commit

Permalink
fixup! refactor: rewrite test code
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Aug 30, 2024
1 parent 0475125 commit 61e0a78
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '../fixtures/input';

const TEST_CASES = [
{ NAME: 'LOW SALARY',
{ NAME: 'low',
MONTLY_PAY: '400',
VACATION_MONEY: '16',
BUSINESS_ACTIVITIES: {
Expand All @@ -28,7 +28,7 @@ const TEST_CASES = [
70: '224,00',
},
},
{ NAME: 'MED SALARY',
{ NAME: 'medium',
MONTLY_PAY: '1000',
VACATION_MONEY: '42',
BUSINESS_ACTIVITIES: {
Expand All @@ -42,7 +42,7 @@ const TEST_CASES = [
70: '562,00',
},
},
{ NAME: 'HIGH SALARY',
{ NAME: 'high',
MONTLY_PAY: '2000',
VACATION_MONEY: '88',
BUSINESS_ACTIVITIES: {
Expand All @@ -65,7 +65,7 @@ test.beforeEach(async ({ page }) => {
});

TEST_CASES.forEach((testCase) => {
test(`(${testCase.NAME}) [Business] Fill in form and check correct calculations as business (none)`, async ({ page }) => {
test(`[Business, ${testCase.NAME}] Fill in form and check results (none)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeBusiness(page);
Expand All @@ -74,7 +74,7 @@ TEST_CASES.forEach((testCase) => {
expectResult(page, testCase.BUSINESS_ACTIVITIES.NONE);
});

test(`(${testCase.NAME}) [Business] Fill in form and check correct calculations as business (50)`, async ({ page }) => {
test(`[Business, ${testCase.NAME}] Fill in form and check results (50)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeBusiness(page);
Expand All @@ -84,7 +84,7 @@ TEST_CASES.forEach((testCase) => {
expectResult(page, testCase.BUSINESS_ACTIVITIES['50']);
});

test(`(${testCase.NAME}) [Business] Fill in form and check correct calculations as business (70)`, async ({ page }) => {
test(`[Business, ${testCase.NAME}] Fill in form and check results (70)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeBusiness(page);
Expand All @@ -94,7 +94,7 @@ TEST_CASES.forEach((testCase) => {
expectResult(page, testCase.BUSINESS_ACTIVITIES['70']);
});

test(`(${testCase.NAME}) [Association: business] Fill in form and check correct calculations with no pay subsidy`, async ({ page }) => {
test(`[Association, ${testCase.NAME}: business] Fill in form and check results (none)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeAssociation(page);
Expand All @@ -104,7 +104,7 @@ TEST_CASES.forEach((testCase) => {
expectResult(page, testCase.BUSINESS_ACTIVITIES.NONE);
});

test(`(${testCase.NAME}) [Association: business] Fill in form and check correct calculations as 50 %`, async ({ page }) => {
test(`[Association, ${testCase.NAME}: business] Fill in form and check results (50)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeAssociation(page);
Expand All @@ -115,7 +115,7 @@ TEST_CASES.forEach((testCase) => {
expectResult(page, testCase.BUSINESS_ACTIVITIES['50']);
});

test(`(${testCase.NAME}) [Association: business] Fill in form and check correct calculations as 70 %`, async ({ page }) => {
test(`[Association, ${testCase.NAME}: business] Fill in form and check results (70)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeAssociation(page);
Expand All @@ -126,7 +126,7 @@ TEST_CASES.forEach((testCase) => {
expectResult(page, testCase.BUSINESS_ACTIVITIES['70']);
});

test(`(${testCase.NAME}) [Association] Fill in form and check correct calculations as association (none)`, async ({ page }) => {
test(`[Association, ${testCase.NAME}] Fill in form and check results (none)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeAssociation(page);
Expand All @@ -135,7 +135,7 @@ TEST_CASES.forEach((testCase) => {
expectResult(page, testCase.ASSOCIATION.NONE);
});

test(`(${testCase.NAME}) [Association] Fill in form and check correct calculations as association (50)`, async ({ page }) => {
test(`[Association, ${testCase.NAME}] Fill in form and check results (50)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeAssociation(page);
Expand All @@ -145,7 +145,7 @@ TEST_CASES.forEach((testCase) => {
expectResult(page, testCase.ASSOCIATION['50']);
});

test(`(${testCase.NAME}) [Association] Fill in form and check correct calculations as association (70)`, async ({ page }) => {
test(`[Association, ${testCase.NAME}] Fill in form and check results (70)`, async ({ page }) => {
await fillMonthlyPay(page, testCase.MONTLY_PAY);
await fillVacationMoney(page, testCase.VACATION_MONEY);
await selectCompanyTypeAssociation(page);
Expand Down

0 comments on commit 61e0a78

Please sign in to comment.