Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-time-input] - Mode changing issue on JAWS and SR fixes #2017

Merged
merged 18 commits into from
Feb 12, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ exports[`DateInput correctly applies the theme context className 1`] = `
refCallback={[Function]}
required={false}
size="2"
type="text"
type="number"
value="04"
>
<input
Expand All @@ -293,7 +293,7 @@ exports[`DateInput correctly applies the theme context className 1`] = `
pattern="\\\\d*"
required={false}
size="2"
type="text"
type="number"
value="04"
/>
</Input>
Expand Down Expand Up @@ -367,7 +367,7 @@ exports[`DateInput correctly applies the theme context className 1`] = `
refCallback={[Function]}
required={false}
size="4"
type="text"
type="number"
value="2000"
>
<input
Expand All @@ -389,7 +389,7 @@ exports[`DateInput correctly applies the theme context className 1`] = `
pattern="\\\\d*"
required={false}
size="4"
type="text"
type="number"
value="2000"
/>
</Input>
Expand Down Expand Up @@ -538,7 +538,7 @@ exports[`DateInput should not have duplicate ids on the page when multiple date
name="terra-date-day-date-input"
pattern="\\\\d*"
size="2"
type="text"
type="number"
value=""
/>
<span
Expand All @@ -559,7 +559,7 @@ exports[`DateInput should not have duplicate ids on the page when multiple date
name="terra-date-year-date-input"
pattern="\\\\d*"
size="4"
type="text"
type="number"
value=""
/>
<span
Expand Down Expand Up @@ -691,7 +691,7 @@ exports[`DateInput should not have duplicate ids on the page when multiple date
name="terra-date-day-date-input-2"
pattern="\\\\d*"
size="2"
type="text"
type="number"
value=""
/>
<span
Expand All @@ -712,7 +712,7 @@ exports[`DateInput should not have duplicate ids on the page when multiple date
name="terra-date-year-date-input-2"
pattern="\\\\d*"
size="4"
type="text"
type="number"
value=""
/>
<span
Expand Down Expand Up @@ -844,7 +844,7 @@ exports[`DateInput should not have duplicate ids on the page when multiple date
name="terra-date-day-date-input-3"
pattern="\\\\d*"
size="2"
type="text"
type="number"
value=""
/>
<span
Expand All @@ -865,7 +865,7 @@ exports[`DateInput should not have duplicate ids on the page when multiple date
name="terra-date-year-date-input-3"
pattern="\\\\d*"
size="4"
type="text"
type="number"
value=""
/>
<span
Expand Down Expand Up @@ -2487,7 +2487,7 @@ exports[`DateInputField correctly applies the theme context className 1`] = `
refCallback={[Function]}
required={false}
size="2"
type="text"
type="number"
value="04"
>
<input
Expand All @@ -2509,7 +2509,7 @@ exports[`DateInputField correctly applies the theme context className 1`] = `
pattern="\\\\d*"
required={false}
size="2"
type="text"
type="number"
value="04"
/>
</Input>
Expand Down Expand Up @@ -2586,7 +2586,7 @@ exports[`DateInputField correctly applies the theme context className 1`] = `
refCallback={[Function]}
required={false}
size="4"
type="text"
type="number"
value="2000"
>
<input
Expand All @@ -2608,7 +2608,7 @@ exports[`DateInputField correctly applies the theme context className 1`] = `
pattern="\\\\d*"
required={false}
size="4"
type="text"
type="number"
value="2000"
/>
</Input>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 12 additions & 28 deletions packages/terra-date-time-picker/tests/wdio/date-time-picker-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {
expect($('input[name="terra-date-day-input"]')).toHaveValue((`0${today.date()}`).slice(-2));
expect($('input[name="terra-time-hour-input"]')).toHaveValue((`0${today.hour()}`).slice(-2));
expect($('input[name="terra-time-minute-input"]')).toHaveValue((`0${today.minute()}`).slice(-2));
const minuteValue = Number($('input[name="terra-time-minute-input"]').getValue());
const minuteTimeValue = today.minutes();
const minuteInRange = (minuteTimeValue === minuteValue + 1 || minuteTimeValue === minuteValue);
expect(minuteInRange).toBe(true);
});

it('should set date to today in the second input', () => {
Expand All @@ -709,10 +713,6 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {
expect($('input[name="terra-date-day-input"]')).toHaveValue((`0${today.date()}`).slice(-2));
expect($('input[name="terra-time-hour-input"]')).toHaveValue((`0${today.hour()}`).slice(-2));
expect($('input[name="terra-time-minute-input"]')).toHaveValue((`0${today.minute()}`).slice(-2));
const secondsValue = Number($('input[name="terra-time-second-input"]').getValue());
const secondsTimeValue = today.seconds();
const secondsInRange = (secondsTimeValue === secondsValue + 1 || secondsTimeValue === secondsValue);
expect(secondsInRange).toBe(true);
});
});

Expand Down Expand Up @@ -769,10 +769,6 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {
expect($('input[name="terra-date-day-input"]')).toHaveValue((`0${today.date()}`).slice(-2));
expect($('input[name="terra-time-hour-input"]')).toHaveValue((`0${today.hour()}`).slice(-2));
expect($('input[name="terra-time-minute-input"]')).toHaveValue((`0${today.minute()}`).slice(-2));
const secondsValue = Number($('input[name="terra-time-second-input"]').getValue());
const secondsTimeValue = today.seconds();
const secondsInRange = (secondsTimeValue === secondsValue + 1 || secondsTimeValue === secondsValue);
expect(secondsInRange).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

});
});

Expand Down Expand Up @@ -817,17 +813,13 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {
expect($('input[name="terra-date-day-input"]')).toHaveValue((`0${today.date()}`).slice(-2));
expect($('input[name="terra-time-hour-input"]')).toHaveValue((`0${today.hour()}`).slice(-2));
expect($('input[name="terra-time-minute-input"]')).toHaveValue((`0${today.minute()}`).slice(-2));
const secondsValue = Number($('input[name="terra-time-second-input"]').getValue());
const secondsTimeValue = today.seconds();
const secondsInRange = (secondsTimeValue === secondsValue + 1 || secondsTimeValue === secondsValue);
expect(secondsInRange).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

});
});
});

describe('-', () => {
describe('if blank date', () => {
it('should set date to today and now minus 1 minute in the hour input', () => {
it('should set date to today and now minus 1 hour in the hour input', () => {
browser.url('/raw/tests/cerner-terra-framework-docs/date-time-picker/date-time-picker-default');
browser.refresh();
$('input[name="terra-time-hour-input"]').click();
Expand Down Expand Up @@ -863,13 +855,13 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {
expect(minuteInRange).toBe(true);
});

it('should set date to today and now minus 1 minute in the second input', () => {
it('should set date to today and now minus 1 second in the second input', () => {
browser.url('/raw/tests/cerner-terra-framework-docs/date-time-picker/date-time-picker-with-seconds');
browser.refresh();
$('input[name="terra-time-second-input"]').click();
browser.keys('-');

const today = moment.utc().subtract(1, 'minutes');
const today = moment.utc().subtract(1, 'seconds');
expect($('input[name="terra-date-year-input"]')).toHaveValue(today.year().toString());
expect($('input[name="terra-date-month-input"]')).toHaveValue((`0${(today.month() + 1)}`).slice(-2));
expect($('input[name="terra-date-day-input"]')).toHaveValue((`0${today.date()}`).slice(-2));
Expand Down Expand Up @@ -1150,7 +1142,7 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {

describe('+', () => {
describe('if blank date', () => {
it('should set date to today and now plus 1 minute in the hour input', () => {
it('should set date to today and now plus 1 hour in the hour input', () => {
browser.url('/raw/tests/cerner-terra-framework-docs/date-time-picker/date-time-picker-default');
browser.refresh();
$('input[name="terra-time-hour-input"]').click();
Expand Down Expand Up @@ -1186,22 +1178,18 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {
expect(minuteInRange).toBe(true);
});

it('should set date to today and now plus 1 minute in the second input', () => {
it('should set date to today and now plus 1 seconds in the second input', () => {
browser.url('/raw/tests/cerner-terra-framework-docs/date-time-picker/date-time-picker-with-seconds');
browser.refresh();
$('input[name="terra-time-second-input"]').click();
browser.keys('+');

const today = moment.utc().add(1, 'minutes');
const today = moment.utc().add(1, 'seconds');
expect($('input[name="terra-date-year-input"]')).toHaveValue(today.year().toString());
expect($('input[name="terra-date-month-input"]')).toHaveValue((`0${(today.month() + 1)}`).slice(-2));
expect($('input[name="terra-date-day-input"]')).toHaveValue((`0${today.date()}`).slice(-2));
expect($('input[name="terra-time-hour-input"]')).toHaveValue((`0${today.hour()}`).slice(-2));
expect($('input[name="terra-time-minute-input"]')).toHaveValue((`0${today.minute()}`).slice(-2));
const secondsValue = Number($('input[name="terra-time-second-input"]').getValue());
const secondsTimeValue = today.seconds();
const secondsInRange = (secondsTimeValue === secondsValue + 1 || secondsTimeValue === secondsValue);
expect(secondsInRange).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test says that you are testing +1 sec to the seconds but I cannot see the validation for seconds field here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

});
});

Expand Down Expand Up @@ -1246,7 +1234,7 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {
expect(minuteInRange).toBe(true);
});

it('should set date to today and now plus 1 minute in the second input', () => {
it('should set date to today and now plus 1 second in the second input', () => {
browser.url('/raw/tests/cerner-terra-framework-docs/date-time-picker/date-time-picker-with-seconds');
browser.refresh();
$('input[name="terra-date-year-input"]').click();
Expand All @@ -1256,16 +1244,12 @@ Terra.describeViewports('DateTimePicker', ['large'], () => {
$('input[name="terra-time-second-input"]').click();
browser.keys('+');

const today = moment.utc().add(1, 'minutes');
const today = moment.utc().add(1, 'seconds');
expect($('input[name="terra-date-year-input"]')).toHaveValue(today.year().toString());
expect($('input[name="terra-date-month-input"]')).toHaveValue((`0${(today.month() + 1)}`).slice(-2));
expect($('input[name="terra-date-day-input"]')).toHaveValue((`0${today.date()}`).slice(-2));
expect($('input[name="terra-time-hour-input"]')).toHaveValue((`0${today.hour()}`).slice(-2));
expect($('input[name="terra-time-minute-input"]')).toHaveValue((`0${today.minute()}`).slice(-2));
const secondsValue = Number($('input[name="terra-time-second-input"]').getValue());
const secondsTimeValue = today.seconds();
const secondsInRange = (secondsTimeValue === secondsValue + 1 || secondsTimeValue === secondsValue);
expect(secondsInRange).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test says that you are testing +1 sec to the seconds but you have removed seconds field validation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

});
});

Expand Down
4 changes: 4 additions & 0 deletions packages/terra-time-input/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Changed
* Changed `up`,`down` key functionality to same as `+`,`-` functionality to make uniform.
* Changed `terra-time-input` type `number` instead of `text`.

## 4.61.0 - (January 25, 2024)

* Changed
Expand Down
Loading
Loading