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,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"testModules": [
|
"testModules": [
|
||||||
{
|
{
|
||||||
"moduleId": "/Users/egullickson/Documents/Technology/coding/motovaultpro/frontend/src/pages/__tests__/GuidePage.test.tsx",
|
"moduleId": "/Users/egullickson/Documents/Technology/coding/motovaultpro/frontend/src/features/dashboard/components/__tests__/ActionBar.test.tsx",
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
"name": "Module failed to load (Error)",
|
"name": "Module failed to load (Error)",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -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 React from 'react';
|
||||||
import Button from '@mui/material/Button';
|
import Button from '@mui/material/Button';
|
||||||
import Add from '@mui/icons-material/Add';
|
import Add from '@mui/icons-material/Add';
|
||||||
import LocalGasStation from '@mui/icons-material/LocalGasStation';
|
|
||||||
|
|
||||||
interface ActionBarProps {
|
interface ActionBarProps {
|
||||||
onAddVehicle: () => void;
|
onAddVehicle: () => void;
|
||||||
@@ -25,13 +25,13 @@ export const ActionBar: React.FC<ActionBarProps> = ({ onAddVehicle, onLogFuel })
|
|||||||
Add Vehicle
|
Add Vehicle
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="contained"
|
||||||
size="small"
|
size="small"
|
||||||
startIcon={<LocalGasStation />}
|
startIcon={<Add />}
|
||||||
onClick={onLogFuel}
|
onClick={onLogFuel}
|
||||||
sx={{ minHeight: 44 }}
|
sx={{ minHeight: 44 }}
|
||||||
>
|
>
|
||||||
Log Fuel
|
Add Fuel Log
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ describe('ActionBar', () => {
|
|||||||
render(<ActionBar onAddVehicle={onAddVehicle} onLogFuel={onLogFuel} />);
|
render(<ActionBar onAddVehicle={onAddVehicle} onLogFuel={onLogFuel} />);
|
||||||
|
|
||||||
expect(screen.getByText('Add Vehicle')).toBeInTheDocument();
|
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', () => {
|
it('calls onAddVehicle when Add Vehicle button clicked', () => {
|
||||||
@@ -24,13 +24,13 @@ describe('ActionBar', () => {
|
|||||||
expect(onAddVehicle).toHaveBeenCalledTimes(1);
|
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 onAddVehicle = jest.fn();
|
||||||
const onLogFuel = jest.fn();
|
const onLogFuel = jest.fn();
|
||||||
|
|
||||||
render(<ActionBar onAddVehicle={onAddVehicle} onLogFuel={onLogFuel} />);
|
render(<ActionBar onAddVehicle={onAddVehicle} onLogFuel={onLogFuel} />);
|
||||||
|
|
||||||
const logFuelButton = screen.getByText('Log Fuel');
|
const logFuelButton = screen.getByText('Add Fuel Log');
|
||||||
fireEvent.click(logFuelButton);
|
fireEvent.click(logFuelButton);
|
||||||
|
|
||||||
expect(onLogFuel).toHaveBeenCalledTimes(1);
|
expect(onLogFuel).toHaveBeenCalledTimes(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user