feat: add enable/disable toggle for chore scheduling in ScheduleModal
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m39s
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m39s
- Introduced a toggle button to enable or disable chores in the scheduler. - The toggle will be available in both types of schedulers. - Added UI design proposal and considerations for mobile dimensions. - Included E2E tests to ensure toggle state persistence and correct behavior in child view.
This commit is contained in:
@@ -43,6 +43,12 @@ ACCESS_TOKEN_EXPIRY_MINUTES = 15
|
||||
E2E_TEST_EMAIL = 'e2e@test.com'
|
||||
E2E_TEST_PASSWORD = 'E2eTestPass1!'
|
||||
E2E_TEST_PIN = '1234'
|
||||
E2E_DELETE_EMAIL = 'e2e-delete@test.com'
|
||||
E2E_DELETE_PASSWORD = 'E2eDeletePass1!'
|
||||
E2E_DELETE_PIN = '5678'
|
||||
E2E_CC_EMAIL = 'e2e-cc@test.com'
|
||||
E2E_CC_PASSWORD = 'E2eCCPass1!'
|
||||
E2E_CC_PIN = '3456'
|
||||
|
||||
|
||||
def send_verification_email(to_email, token):
|
||||
@@ -470,6 +476,52 @@ def logout():
|
||||
return resp, 200
|
||||
|
||||
|
||||
@auth_api.route('/e2e-create-delete-user', methods=['POST'])
|
||||
def e2e_create_delete_user():
|
||||
"""Create a secondary e2e test user for deletion testing. Only available outside production."""
|
||||
if os.environ.get('DB_ENV', 'prod') == 'prod':
|
||||
return jsonify({'error': 'Not available in production'}), 403
|
||||
|
||||
norm_email = normalize_email(E2E_DELETE_EMAIL)
|
||||
users_db.remove(UserQuery.email == norm_email)
|
||||
user = User(
|
||||
first_name='E2E',
|
||||
last_name='Delete',
|
||||
email=norm_email,
|
||||
password=generate_password_hash(E2E_DELETE_PASSWORD),
|
||||
verified=True,
|
||||
role='user',
|
||||
pin=E2E_DELETE_PIN,
|
||||
)
|
||||
users_db.insert(user.to_dict())
|
||||
return jsonify({'email': norm_email}), 201
|
||||
|
||||
|
||||
@auth_api.route('/e2e-create-cc-user', methods=['POST'])
|
||||
def e2e_create_cc_user():
|
||||
"""Create an isolated e2e test user for create-child tests. Only available outside production."""
|
||||
if os.environ.get('DB_ENV', 'prod') == 'prod':
|
||||
return jsonify({'error': 'Not available in production'}), 403
|
||||
|
||||
norm_email = normalize_email(E2E_CC_EMAIL)
|
||||
# Remove old user and all their children so deleteAllChildren() starts clean.
|
||||
existing = users_db.get(UserQuery.email == norm_email)
|
||||
if existing:
|
||||
child_db.remove(Query().user_id == existing.get('id'))
|
||||
users_db.remove(UserQuery.email == norm_email)
|
||||
user = User(
|
||||
first_name='E2E',
|
||||
last_name='CreateChild',
|
||||
email=norm_email,
|
||||
password=generate_password_hash(E2E_CC_PASSWORD),
|
||||
verified=True,
|
||||
role='user',
|
||||
pin=E2E_CC_PIN,
|
||||
)
|
||||
users_db.insert(user.to_dict())
|
||||
return jsonify({'email': norm_email}), 201
|
||||
|
||||
|
||||
@auth_api.route('/e2e-seed', methods=['POST'])
|
||||
def e2e_seed():
|
||||
"""Reset the database and insert a verified test user. Only available outside production."""
|
||||
|
||||
Reference in New Issue
Block a user