Skip to content

Commit

Permalink
EDSC-4125 test fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-zamora committed Jan 14, 2025
1 parent b888b18 commit 7c7a738
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,16 @@ const TemporalSelectionDropdown = ({

// When only start date exists and is in current year, use full range
if (existingStartDate && !existingEndDate) {
const startYear = moment(existingStartDate).utc().year()
const startYear = moment.utc(existingStartDate).year()
console.log('🚀 ~ onRecurringToggle ~ existingStartDate:', existingStartDate)
const currentYear = moment().utc().year()
console.log('🚀 ~ onRecurringToggle ~ currentYear:', currentYear)
console.log('🚀 ~ onRecurringToggle ~ startYear:', startYear)
if (startYear === currentYear) {
setTemporal({
...temporal,
isRecurring: isChecked,
startDate: minDate.startOf('year').toISOString(),
startDate: minDate.toISOString(),
endDate: moment().utc().toISOString()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ describe('TemporalSelectionDropdown component', () => {
})

describe('TemporalSelectionDropdown when dates aren\'t set', () => {
test('handles recurring toggle with only start date set', async () => {
test.only('handles recurring toggle with only start date set', async () => {
MockDate.set('2024-02-01T06:00:00.000Z')
const onChangeQueryMock = jest.fn()
const user = userEvent.setup()
Expand Down Expand Up @@ -823,7 +823,6 @@ describe('TemporalSelectionDropdown component', () => {
const onChangeQueryMock = jest.fn()
const user = userEvent.setup()

console.log('HERE0')
setup({
onChangeQuery: onChangeQueryMock,
temporalSearch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class TemporalSelection extends Component {
}

const { minimumTemporalDateString, temporalDateFormatFull } = getApplicationConfig()
const minimumTemporalDate = moment(minimumTemporalDateString, temporalDateFormatFull).utc()
const minimumTemporalDate = moment(minimumTemporalDateString, temporalDateFormatFull)

let sliderStartDate = moment(temporal.startDate).utc()
if (!sliderStartDate.isValid()) {
Expand Down

0 comments on commit 7c7a738

Please sign in to comment.