nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: gregberge/svgr
Pull request #779 (2022-09-26 12:37:58)

Support spaces in source file names
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

## Summary

Currently source file names that have spaces in them are not converted to component names the same way as the file names, e.g. from `Arrow up.svg` the component name will be `SvgArrowup` and the file name will be `SvgArrowUp.tsx`.

The PR fixes this discrepancy by *not* removing spaces from the file names before converting them to PascalCase.

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

## Test plan

Added a test case.

<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->


vercel[bot]: **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Updated |
| :--- | :----- | :------ | :------ |
| **svgr** | 🔄 Building ([Inspect](https://vercel.com/gregberge/svgr/9oapeQRTZpN1oe6idMkpLHqjoXKp)) |  | Sep 26, 2022 at 0:38AM (UTC) |



Patch:
diff --git a/packages/core/src/state.ts b/packages/core/src/state.ts
index 20e4f09..c9900d5 100644
--- a/packages/core/src/state.ts
+++ b/packages/core/src/state.ts
@@ -13,7 +13,7 @@ export interface State {
   }
 }
 
-const VALID_CHAR_REGEX = /[^a-zA-Z0-9_-]/g
+const VALID_CHAR_REGEX = /[^a-zA-Z0-9 _-]/g
 
 const getComponentName = (filePath?: string): string => {
   if (!filePath) return 'SvgComponent'


Test patch:
diff --git a/packages/core/src/state.test.ts b/packages/core/src/state.test.ts
index 26a304c..e2183d9 100644
--- a/packages/core/src/state.test.ts
+++ b/packages/core/src/state.test.ts
@@ -24,6 +24,11 @@ describe('state', () => {
         filePath: 'a&b~c-d_e.svg',
         componentName: 'SvgAbcDE',
       })
+      expect(expandState({ filePath: 'Arrow up.svg' })).toEqual({
+        filePath: 'Arrow up.svg',
+        componentName: 'SvgArrowUp',
+      })
+
     })
   })
 })
Repository: gregberge/svgr
Pull request #787 (2022-10-12 14:43:44)

feat(babel-preset): fix 'role' attribute on svg element for react native
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

## Summary

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

Fixes 'role' attribute introduced in #750 for react-native

## Test plan

<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->

Upon generation for `native`, instead of web specific `role="img"` attribute, there should be the react-native equivalent `accessibilityRole="image"`.


vercel[bot]: **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Updated |
| :--- | :----- | :------ | :------ |
| **svgr** | 🔄 Building ([Inspect](https://vercel.com/gregberge/svgr/57y1TsduSK7ExKY11fdur8CQMjcc)) |  | Oct 12, 2022 at 2:43PM (UTC) |


slavikdenis: Hi @gregberge 

Seems like you have to update node version in Vercel.
Thanks

![image](https://user-images.githubusercontent.com/15640932/195375533-a184e532-0ac8-4450-88a2-a7255ea4a0c1.png)


Patch:
diff --git a/packages/babel-preset/src/index.ts b/packages/babel-preset/src/index.ts
index 7a5b1b3..de8ec0e 100644
--- a/packages/babel-preset/src/index.ts
+++ b/packages/babel-preset/src/index.ts
@@ -50,10 +50,15 @@ function replaceMapToValues(replaceMap: { [key: string]: string }): Value[] {
 const plugin = (_: ConfigAPI, opts: Options) => {
   let toRemoveAttributes = ['version']
   let toAddAttributes: Attribute[] = [
-    {
-      name: 'role',
-      value: 'img',
-    },
+    opts?.native === true
+      ? {
+          name: 'accessibilityRole',
+          value: 'image',
+        }
+      : {
+          name: 'role',
+          value: 'img',
+        },
   ]
 
   if (opts.svgProps) {


Test patch:
diff --git a/packages/babel-preset/src/index.test.ts b/packages/babel-preset/src/index.test.ts
index 18945f5..5484aec 100644
--- a/packages/babel-preset/src/index.test.ts
+++ b/packages/babel-preset/src/index.test.ts
@@ -213,7 +213,7 @@ describe('preset', () => {
       "import * as React from \\"react\\";
       import Svg from \\"react-native-svg\\";
 
-      const SvgComponent = props => <Svg a=\\"#000\\" b=\\"#fff\\" width={24} height={24} role=\\"img\\" {...props} />;
+      const SvgComponent = props => <Svg a=\\"#000\\" b=\\"#fff\\" width={24} height={24} accessibilityRole=\\"image\\" {...props} />;
 
       export default SvgComponent;"
     `)
Repository: Codeception/CodeceptJS
Pull request #1537 (2019-03-04 13:00:23)

Fix/ withChild and withDescendant work wrong

DavertMik: thank you

Patch:
diff --git a/lib/locator.js b/lib/locator.js
index 8629feaa..f38c4274 100644
--- a/lib/locator.js
+++ b/lib/locator.js
@@ -116,12 +116,12 @@ class Locator {
   }
 
   withChild(locator) {
-    const xpath = sprintf('%s//child::%s', this.toXPath(), removePrefix((new Locator(locator, 'css')).toXPath()));
+    const xpath = sprintf('%s[./child::%s]', this.toXPath(), removePrefix((new Locator(locator, 'css')).toXPath()));
     return new Locator({ xpath });
   }
 
   withDescendant(locator) {
-    const xpath = sprintf('%s//descendant::%s', this.toXPath(), removePrefix((new Locator(locator, 'css')).toXPath()));
+    const xpath = sprintf('%s[./descendant::%s]', this.toXPath(), removePrefix((new Locator(locator, 'css')).toXPath()));
     return new Locator({ xpath });
   }
 


Test patch:
diff --git a/test/unit/locator_test.js b/test/unit/locator_test.js
index 9b5d818f..e4b774e5 100644
--- a/test/unit/locator_test.js
+++ b/test/unit/locator_test.js
@@ -123,13 +123,20 @@ describe('Locator', () => {
 
   it('should select element by siblings', () => {
     const l = Locator.build('//table')
-      .withChild('td')
-      .withText('Also Edit')
-      .first();
+      .withChild(Locator.build('tr')
+        .withChild('td')
+        .withText('Also Edit'));
     const nodes = xpath.select(l.toXPath(), doc);
     expect(nodes).to.have.length(1, l.toXPath());
   });
 
+  it('should not select element by deep nested siblings', () => {
+    const l = Locator.build('//table')
+      .withChild('td');
+    const nodes = xpath.select(l.toXPath(), doc);
+    expect(nodes).to.have.length(0, l.toXPath());
+  });
+
   it('should select element by siblings', () => {
     const l = Locator.build('//table')
       .find('td')