fix: Update log fuel buttons
All checks were successful
Deploy to Staging / Build Images (push) Successful in 3m34s
Deploy to Staging / Deploy to Staging (push) Successful in 52s
Deploy to Staging / Verify Staging (push) Successful in 8s
Deploy to Staging / Notify Staging Ready (push) Successful in 8s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
All checks were successful
Deploy to Staging / Build Images (push) Successful in 3m34s
Deploy to Staging / Deploy to Staging (push) Successful in 52s
Deploy to Staging / Verify Staging (push) Successful in 8s
Deploy to Staging / Notify Staging Ready (push) Successful in 8s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @ai-summary Compact action bar for dashboard with Add Vehicle and Log Fuel buttons
|
||||
* @ai-summary Compact action bar for dashboard with Add Vehicle and Add Fuel Log buttons
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import Button from '@mui/material/Button';
|
||||
import Add from '@mui/icons-material/Add';
|
||||
import LocalGasStation from '@mui/icons-material/LocalGasStation';
|
||||
|
||||
|
||||
interface ActionBarProps {
|
||||
onAddVehicle: () => void;
|
||||
@@ -25,13 +25,13 @@ export const ActionBar: React.FC<ActionBarProps> = ({ onAddVehicle, onLogFuel })
|
||||
Add Vehicle
|
||||
</Button>
|
||||
<Button
|
||||
variant="outlined"
|
||||
variant="contained"
|
||||
size="small"
|
||||
startIcon={<LocalGasStation />}
|
||||
startIcon={<Add />}
|
||||
onClick={onLogFuel}
|
||||
sx={{ minHeight: 44 }}
|
||||
>
|
||||
Log Fuel
|
||||
Add Fuel Log
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ describe('ActionBar', () => {
|
||||
render(<ActionBar onAddVehicle={onAddVehicle} onLogFuel={onLogFuel} />);
|
||||
|
||||
expect(screen.getByText('Add Vehicle')).toBeInTheDocument();
|
||||
expect(screen.getByText('Log Fuel')).toBeInTheDocument();
|
||||
expect(screen.getByText('Add Fuel Log')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('calls onAddVehicle when Add Vehicle button clicked', () => {
|
||||
@@ -24,13 +24,13 @@ describe('ActionBar', () => {
|
||||
expect(onAddVehicle).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('calls onLogFuel when Log Fuel button clicked', () => {
|
||||
it('calls onLogFuel when Add Fuel Log button clicked', () => {
|
||||
const onAddVehicle = jest.fn();
|
||||
const onLogFuel = jest.fn();
|
||||
|
||||
render(<ActionBar onAddVehicle={onAddVehicle} onLogFuel={onLogFuel} />);
|
||||
|
||||
const logFuelButton = screen.getByText('Log Fuel');
|
||||
const logFuelButton = screen.getByText('Add Fuel Log');
|
||||
fireEvent.click(logFuelButton);
|
||||
|
||||
expect(onLogFuel).toHaveBeenCalledTimes(1);
|
||||
|
||||
Reference in New Issue
Block a user