• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SyTW2223 / E01 / 3976491236

pending completion
3976491236

push

github

juanmdom
test y responsividad

18 of 66 branches covered (27.27%)

Branch coverage included in aggregate %.

7 of 12 new or added lines in 5 files covered. (58.33%)

211 of 408 relevant lines covered (51.72%)

1.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/client/src/components/form/ObjectiveForm.jsx
1
import React from 'react';
2
import { TextField, 
3
         List,
4
         Button,
5
         Container, 
6
         IconButton,
7
         } from '@mui/material';
8
import DeleteIcon from '@mui/icons-material/Delete';
9
import TaskForm from './TaskForm';
10
import { theme } from '../../themes/mainTheme';
11
import DoneAllIcon from '@mui/icons-material/DoneAll';
12

13
const ObjectiveForm = ({ objective, objectiveIndex, handleTaskChange, handleDeleteTask, handleObjectiveChange, handleAddTask,
3✔
14
                         handleCompleteObjective, handleDeleteObjective }) => {
15

16
  const useStyles = {
3✔
17
    bgcolor: theme.palette.primary.secondary,
18
    paddingTop: 2,
19
    marginTop: 1,
20
    marginBottom: 2,
21
    borderRadius: '15px'
22
  };
23

24
  return (
3✔
25
    <Container key={objectiveIndex} sx={useStyles}>
26
      <TextField
27
        InputProps={{
28
          style: { color: '#658864' },
29
        }}
30
        required
31
        variant="outlined"
32
        label="Objective"
33
        value={objective.name}
34
        onChange={(event) => handleObjectiveChange(event, objectiveIndex)}
×
35
        disabled={objective.completed}
36
        fullWidth
37
        sx={{
38
          bgcolor: 'secondary.secondary',
39
          maxHeight: '150px',
40
          marginBottom: 2,
41
          borderRadius: 1,
42
          borderColor: 'secondary.main',
43
        }}
44
      />
NEW
45
      {!objective.completed && <Button onClick={() => handleAddTask(objectiveIndex)} data-testid="add-task-btn"
✔
46
        sx={{
47
          bgcolor: 'primary.main',
48
          color: 'secondary.secondary',
49
          '&:hover': {
50
            color: 'primary.main',
51
          }
52
        }}
53
        >
54
        Add Task
55
       </Button>}
56
      <Button onClick={() => handleCompleteObjective(objectiveIndex)} disabled={objective.completed} sx={{maxWidth: '1px'}}>
×
57
        <DoneAllIcon
58
          data-testid="complete-objective-btn"
59
          sx={{
60
            borderRadius: 1,
61
            color: 'primary.main',
62
            marginX: 2
63
          }}/>
64
      </Button>
NEW
65
      <IconButton onClick={() => handleDeleteObjective(objectiveIndex)} data-testid="delete-objective-btn"> <DeleteIcon 
×
66
          sx={{
67
            color: 'primary.main',
68
          }}
69
      />  </IconButton>
70
      {/* Task Form */}
71
      <List>
72
        {!objective.completed && objective.tasks.map((task, taskIndex) => (
6✔
73
          <TaskForm 
6✔
74
            key={taskIndex}
75
            task={task} 
76
            taskIndex={taskIndex} 
77
            objectiveIndex={objectiveIndex} 
78
            handleTaskChange={handleTaskChange}
79
            handleDeleteTask={handleDeleteTask}
80
            objectiveCompleted={objective.completed}
81
          />))
82
        }
83
      </List>
84
    </Container>
85
  )
86
}
87

88
export default ObjectiveForm
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc