Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ranven committed Oct 3, 2024
2 parents d7e5f32 + a1d6dd0 commit 8cea1a8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Square = ({ color, setQuestionModal, answerObject, chevron = null }) => {
const { backgroundColor, hover } = colors[color] || colors.gray

return (
<div className="square-container">
<div className="square-container" data-cy={`square-${answerObject.faculty}-${answerObject.part.id}`}>
<Card
style={{
...squareStyles,
Expand Down
4 changes: 2 additions & 2 deletions client/components/Generic/TrackingTrafficLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const TrackingTrafficLight = ({ id, form }) => {
<Menu secondary style={{ display: 'flex', flexWrap: 'wrap' }}>
{displayedHistory.length ? (
displayedHistory.map((entry, index) => (
<Menu.Item>
<Menu.Item key={`${entry.date}-${index}`}>
<span className={`answer-circle-big-${entry.color}`} />
<i>
{new Date(entry.date)
Expand Down Expand Up @@ -99,7 +99,7 @@ const TrackingTrafficLight = ({ id, form }) => {
<Grid columns={4} style={{ margin: '1em 0' }}>
<b>{t('chooseTrafficLight')}</b>
<Grid.Row>
<Grid.Column>
<Grid.Column data-cy="date-picker">
<DatePicker
dateFormat="dd.MM.yyyy"
onChange={setCustomDate}
Expand Down
30 changes: 29 additions & 1 deletion cypress/integration/trackingpage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Tracking page tests', () => {

cy.get('[data-cy=questions-list-0]').click()

cy.contains('1. Degree programmes include model schedules in curricula that support understanding of the education system, study paths, and course offerings').click()
cy.contains('1.').click()
cy.contains('2.').click()
cy.get('[data-cy=send-selection-button]').click()

Expand All @@ -61,4 +61,32 @@ describe('Tracking page tests', () => {

cy.get('[data-cy=send-form]').click()
})

it('should modify the date', () => {
cy.get(`[data-cy=question-picker-${testFacultyCode}]`).click()

cy.get('[data-cy=questions-list-0]').click()

cy.contains('1.').click()
cy.get('[data-cy=send-selection-button]').click()

cy.get('[data-cy=accordion-group-0]').click()
cy.get('[data-cy=modify-plan-1]').click()

cy.get('[data-cy=toggle-chooser]').click()
cy.get('[data-cy=color-positive-1]').click()

cy.get('[data-cy=toggle-chooser]').click()
cy.get('[data-cy=date-picker]').type('{selectAll}01.01.2000')
cy.get('[data-cy=color-negative-1]').click()

cy.get('[data-cy=send-form]').click()
cy.contains('01.01.2000').should('exist')

cy.visit(`/faculty-monitoring`)
cy.contains('Development Area 1:').click()

cy.get(`[data-cy=square-${testFacultyCode}-1]`).click()
cy.contains('01.01.2000').should('exist')
})
})

0 comments on commit 8cea1a8

Please sign in to comment.