Skip to content

Commit 32c4e15

Browse files
author
Daniel Tonon
committed
Merge branch 'switching-tests-to-npm-package'
2 parents 454c8fb + bae102f commit 32c4e15

File tree

83 files changed

+2559
-2732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2559
-2732
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ You can view a demo of the original plain javascript version here: https://dan50
1818

1919
The component was built to work in [create-react-app](https://create-react-app.dev/docs/getting-started) projects. It should work ok in other React based frameworks though as well.
2020

21+
> **`react-scripts` v5 is currently not supported.**
22+
>
23+
> This is related to React upgrading to Webpack v5. [This linked issue](https://github.com/facebook/create-react-app/issues/11865) is blocking my ability to support `react-scripts` v5.
24+
2125
Install the polyfill component with npm:
2226

2327
```
@@ -96,19 +100,17 @@ You can also force-enable the polyfill so that it is active in modern browsers t
96100
import React from 'react'
97101
import { TimeInputPolyfill } from '@time-input-polyfill/react'
98102

99-
export function TimeInput({ label, currentValue, onInputChange }) {
103+
export function TimeInput({ label, value, setValue }) {
100104
return (
101105
<label>
102106
<span>{label}</span>
103107
<TimeInputPolyfill
104-
value={currentValue}
108+
value={value}
109+
setValue={setValue}
105110
/* Force browsers that support input[type=time]
106111
to use the polyfill.
107112
(useful for testing and debugging) */
108113
forcePolyfill={true}
109-
onChange={({ value, element }) => {
110-
onInputChange(value)
111-
}}
112114
/>
113115
</label>
114116
)
@@ -192,8 +194,8 @@ Note: It is still possible to use `onChange`, however this is just an extension
192194

193195
In version 1, you would import the polyfill utils from here:
194196

195-
`@time-input-polyfill/react/dist/timePolyfillUtils.js`.
197+
`react-time-input-polyfill/dist/timePolyfillUtils.js`.
196198

197-
That doesn't exist anymore, you need to import from here instead now:
199+
In version 2, you will need to import from here instead now:
198200

199201
`@time-input-polyfill/utils/npm/time-input-polyfill-utils.min.js`

cypress/integration/button-tests.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { functionVsClassBased } from '../../support/functionVsClassBased'
2+
import { testSuite } from '../../support/testSuite'
3+
4+
functionVsClassBased({
5+
functionBased: testSuite.functionBased.tests.buttons.am,
6+
classBased: testSuite.classBased.tests.buttons.am
7+
})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { functionVsClassBased } from '../../support/functionVsClassBased'
2+
import { testSuite } from '../../support/testSuite'
3+
4+
functionVsClassBased({
5+
functionBased: testSuite.functionBased.tests.buttons.blank,
6+
classBased: testSuite.classBased.tests.buttons.blank
7+
})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { functionVsClassBased } from '../../support/functionVsClassBased'
2+
import { testSuite } from '../../support/testSuite'
3+
4+
functionVsClassBased({
5+
functionBased: testSuite.functionBased.tests.buttons.pm,
6+
classBased: testSuite.classBased.tests.buttons.pm
7+
})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { functionVsClassBased } from '../../support/functionVsClassBased'
2+
import { testSuite } from '../../support/testSuite'
3+
4+
functionVsClassBased({
5+
functionBased: testSuite.functionBased.tests.buttons.togglePolyfill,
6+
classBased: testSuite.classBased.tests.buttons.togglePolyfill
7+
})

cypress/integration/event-tests.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { functionVsClassBased } from '../../support/functionVsClassBased'
2+
import { testSuite } from '../../support/testSuite'
3+
4+
functionVsClassBased({
5+
functionBased: testSuite.functionBased.tests.events.all,
6+
classBased: testSuite.classBased.tests.events.all
7+
})

cypress/integration/hour-segment-tests.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { functionVsClassBased } from '../../support/functionVsClassBased'
2+
import { testSuite } from '../../support/testSuite'
3+
4+
functionVsClassBased({
5+
functionBased: testSuite.functionBased.tests.hours.hrs24Values,
6+
classBased: testSuite.classBased.tests.hours.hrs24Values
7+
})

0 commit comments

Comments
 (0)