nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: gpbl/react-day-picker
Pull request #436 (2017-06-26 16:34:17)

Prevent default event


Patch:
diff --git a/src/Navbar.js b/src/Navbar.js
index 7bd28728b..dd3255629 100644
--- a/src/Navbar.js
+++ b/src/Navbar.js
@@ -39,6 +39,7 @@ export default class Navbar extends Component {
     if (e.keyCode !== ENTER && e.keyCode !== SPACE) {
       return;
     }
+    e.preventDefault();
     this.handleNextClick();
   };
 
@@ -46,6 +47,7 @@ export default class Navbar extends Component {
     if (e.keyCode !== ENTER && e.keyCode !== SPACE) {
       return;
     }
+    e.preventDefault();
     this.handlePreviousClick();
   };
 


Test patch:
diff --git a/test/Navbar.js b/test/Navbar.js
index e218a4827..d2c12d7dd 100644
--- a/test/Navbar.js
+++ b/test/Navbar.js
@@ -88,12 +88,14 @@ describe('<Navbar />', () => {
   });
   it('should call `onNextClick` when pressing ENTER or SPACE on the next button', () => {
     const handleNextClick = jest.fn();
+    const preventDefault = jest.fn();
     const wrapper = shallow(<Navbar onNextClick={handleNextClick} />);
     wrapper
       .find('.DayPicker-NavButton--next')
-      .simulate('keydown', { keyCode: ENTER })
-      .simulate('keydown', { keyCode: SPACE });
+      .simulate('keydown', { keyCode: ENTER, preventDefault })
+      .simulate('keydown', { keyCode: SPACE, preventDefault });
     expect(handleNextClick).toHaveBeenCalledTimes(2);
+    expect(preventDefault).toHaveBeenCalledTimes(2);
   });
   it('should not call `onNextClick` when pressing a key different than ENTER or SPACE on the next button', () => {
     const handleNextClick = jest.fn();
@@ -117,12 +119,14 @@ describe('<Navbar />', () => {
   });
   it('should call `onPreviousClick` when pressing ENTER or SPACE on the prev button', () => {
     const handlePreviousClick = jest.fn();
+    const preventDefault = jest.fn();
     const wrapper = shallow(<Navbar onPreviousClick={handlePreviousClick} />);
     wrapper
       .find('.DayPicker-NavButton--prev')
-      .simulate('keydown', { keyCode: ENTER })
-      .simulate('keydown', { keyCode: SPACE });
+      .simulate('keydown', { keyCode: ENTER, preventDefault })
+      .simulate('keydown', { keyCode: SPACE, preventDefault });
     expect(handlePreviousClick).toHaveBeenCalledTimes(2);
+    expect(preventDefault).toHaveBeenCalledTimes(2);
   });
   it('should not call `onPreviousClick` when pressing a key different than ENTER or SPACE on the prev button', () => {
     const handlePreviousClick = jest.fn();
Repository: gpbl/react-day-picker
Pull request #590 (2017-12-20 10:50:56)

Set moment in strict mode
This will cause moment to return `undefined` when parsing a date that doesn't match the format.

 `parseDate` value will not override the input value if it doesn't match the format provided.

For: #584



Patch:
diff --git a/src/addons/MomentLocaleUtils.js b/src/addons/MomentLocaleUtils.js
index 33af27fd0..e50caabd7 100644
--- a/src/addons/MomentLocaleUtils.js
+++ b/src/addons/MomentLocaleUtils.js
@@ -53,7 +53,7 @@ export function formatDate(date, format = 'L', locale = 'en') {
 }
 
 export function parseDate(str, format = 'L', locale = 'en') {
-  const m = moment(str, format, locale);
+  const m = moment(str, format, locale, true);
   if (m.isValid()) {
     return m.toDate();
   }


Test patch:
diff --git a/test/addons/MomentLocaleUtils.js b/test/addons/MomentLocaleUtils.js
index 5850d05bb..0d645f642 100644
--- a/test/addons/MomentLocaleUtils.js
+++ b/test/addons/MomentLocaleUtils.js
@@ -101,5 +101,9 @@ describe('MomentLocaleUtils', () => {
       const parsed = MomentLocaleUtils.parseDate('20 foo 2018', 'LL', 'it');
       expect(parsed).toBeUndefined();
     });
+    it('returns undefined if date does not match the format', () => {
+      const parsed = MomentLocaleUtils.parseDate('20/11/201', 'DD/MM/YYYY');
+      expect(parsed).toBeUndefined();
+    });
   });
 });
Repository: bkbnio/kompendium
Pull request #200 (2022-02-19 22:35:24)

Fix: Unable to use sealed typed collections #199
Fix for https://github.com/bkbnio/kompendium/issues/199

unredundant: Thanks! can you quickly add a 1 line update to the `CHANGELOG.md` under the `unreleased` section?  

I have a separate bug I'm working on today, I'll try to push that out some time, so this should get released either tonight or tomorrow morning :) 
ydanneg: > Thanks! can you quickly add a 1 line update to the `CHANGELOG.md` under the `unreleased` section?
> 
> I have a separate bug I'm working on today, I'll try to push that out some time, so this should get released either tonight or tomorrow morning :)

done

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cd81a2565..9ae2f43f8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
 ### Added
 
 ### Changed
+- Fixed sealed typed collections schema generation
 
 ### Remove
 
diff --git a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/handler/CollectionHandler.kt b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/handler/CollectionHandler.kt
index 101b455f9..0903f1cba 100644
--- a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/handler/CollectionHandler.kt
+++ b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/handler/CollectionHandler.kt
@@ -27,7 +27,6 @@ object CollectionHandler : SchemaHandler {
     val collectionClass = collectionType.classifier as KClass<*>
     logger.debug("Obtained collection class: $collectionClass")
     val referenceName = Helpers.genericNameAdapter(type, clazz)
-    generateKTypeKontent(collectionType, cache)
     val valueReference = when (collectionClass.isSealed) {
       true -> {
         val subTypes = gatherSubTypes(collectionType)
@@ -39,6 +38,7 @@ object CollectionHandler : SchemaHandler {
         })
       }
       false -> {
+        generateKTypeKontent(collectionType, cache)
         val schema = cache[collectionClass.simpleName] ?: error("${collectionClass.simpleName} not found")
         val slug = collectionClass.simpleName!!
         postProcessSchema(schema, slug)


Test patch:
diff --git a/kompendium-core/src/test/resources/polymorphic_list_response.json b/kompendium-core/src/test/resources/polymorphic_list_response.json
index 8dc0f4807..2898dba9c 100644
--- a/kompendium-core/src/test/resources/polymorphic_list_response.json
+++ b/kompendium-core/src/test/resources/polymorphic_list_response.json
@@ -60,10 +60,6 @@
   },
   "components": {
     "schemas": {
-      "FlibbityGibbit": {
-        "properties": {},
-        "type": "object"
-      },
       "SimpleGibbit": {
         "properties": {
           "a": {
Repository: gpbl/react-day-picker
Pull request #1907 (2023-09-12 11:36:16)

fix(a11y): Remove rowgroup role from tbody element
### Context

The `role="rowgroup"` attribute added to the `<tbody>` element in `Table.tsx` is redundant and it may cause html validators to fail. (e.g. #1903).

https://github.com/gpbl/react-day-picker/blob/6fc2614dbcb7016ad0362385b44ea016039bc080/src/components/Table/Table.tsx#L54

### Analysis

The role attribute can be removed as it [is the implicit ARIA role](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody) for `tbody`.

### Solution

Remove the role and update the test screenshots.



Patch:
diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx
index bc90b4152..5548c0af2 100644
--- a/src/components/Table/Table.tsx
+++ b/src/components/Table/Table.tsx
@@ -51,7 +51,7 @@ export function Table(props: TableProps): JSX.Element {
       aria-labelledby={props['aria-labelledby']}
     >
       {!hideHead && <HeadComponent />}
-      <tbody className={classNames.tbody} style={styles.tbody} role="rowgroup">
+      <tbody className={classNames.tbody} style={styles.tbody}>
         {weeks.map((week) => (
           <RowComponent
             displayMonth={props.displayMonth}


Test patch:
diff --git a/src/components/Table/__snapshots__/Table.test.tsx.snap b/src/components/Table/__snapshots__/Table.test.tsx.snap
index fa80e02c4..78641f2dd 100644
--- a/src/components/Table/__snapshots__/Table.test.tsx.snap
+++ b/src/components/Table/__snapshots__/Table.test.tsx.snap
@@ -64,7 +64,6 @@ exports[`should render correctly 1`] = `
   </thead>
   <tbody
     class="rdp-tbody"
-    role="rowgroup"
   >
     <tr
       class="rdp-row"
@@ -524,7 +523,6 @@ exports[`when showing the week numbers should render correctly 1`] = `
   </thead>
   <tbody
     class="rdp-tbody"
-    role="rowgroup"
   >
     <tr
       class="rdp-row"
@@ -976,7 +974,6 @@ exports[`when using custom components should render correctly 1`] = `
   </thead>
   <tbody
     class="rdp-tbody"
-    role="rowgroup"
   >
     <tr>
       <td>
diff --git a/website/test-integration/examples/__snapshots__/range.test.tsx.snap b/website/test-integration/examples/__snapshots__/range.test.tsx.snap
index 827b31c9f..da34b4399 100644
--- a/website/test-integration/examples/__snapshots__/range.test.tsx.snap
+++ b/website/test-integration/examples/__snapshots__/range.test.tsx.snap
@@ -130,7 +130,6 @@ exports[`should match the snapshot 1`] = `
           </thead>
           <tbody
             class="rdp-tbody"
-            role="rowgroup"
           >
             <tr
               class="rdp-row"
@@ -770,7 +769,6 @@ exports[`when a day in the range is clicked when the day is clicked again when a
           </thead>
           <tbody
             class="rdp-tbody"
-            role="rowgroup"
           >
             <tr
               class="rdp-row"