Skip to content

Commit

Permalink
fix: add deprecation for isCommercial parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufttur committed Jan 17, 2025
1 parent c3806a9 commit 9ac91fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tasks/shop-customer/Account/Register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ export const Register = base.extend<{ Register: Task }, FixtureTypes>({
vatRegNo: 'DE1234567890',
};

const task = (overrides?: Partial<RegistrationData>, isCommercial?: boolean) => {
const task = (overrides?: Partial<RegistrationData>,
/**
* @deprecated The 'isCommercial' argument is deprecated and will be removed in a future version.
* Please avoid using it and rely on the `isCommercial` field in `RegistrationData` instead.
*/
isCommercial?: boolean) => {
return async function Register() {
const registrationData = { ...defaultRegistrationData, ...overrides };

registeredEmail = registrationData.email;

// Deprecation warning for the 'isCommercial' argument
if (registrationData.isCommercial || isCommercial) {
await StorefrontAccountLogin.accountTypeSelect.selectOption('Commercial');
await StorefrontAccountLogin.companyInput.fill(registrationData.company);
Expand Down

0 comments on commit 9ac91fc

Please sign in to comment.