Skip to content

Commit da4f1d5

Browse files
Merge pull request #2241 from charlesmulder/fix/security-vulnerabilities-npm-audit
Fix automated tests
2 parents 6a227f5 + 48b3b26 commit da4f1d5

File tree

8 files changed

+1648
-9586
lines changed

8 files changed

+1648
-9586
lines changed

.github/workflows/reporter.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,4 @@ jobs:
1515
- name: Install required dependencies
1616
run: npm ci
1717
- name: Run the tests
18-
run: cd ${{ github.workspace }}/packages/components && npm run test:ct && npx merge-results -c cypress.config.ts
19-
- name: Login to Quay
20-
uses: docker/login-action@v3
21-
with:
22-
registry: quay.io
23-
username: ${{ secrets.QUAY_USERNAME }}
24-
password: ${{ secrets.QUAY_PASSWORD }}
25-
- name: Pull the uploader image
26-
run: podman pull quay.io/cloudservices/iqe-artifact-uploader-s3:latest
27-
- name: Upload the results
28-
run: |
29-
podman run -e AWS_BUCKET=${{ secrets.AWS_BUCKET }} -e AWS_REGION=${{ secrets.AWS_REGION }} \
30-
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} -e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
31-
-v ${{ github.workspace }}/ibutsu-report:/results quay.io/cloudservices/iqe-artifact-uploader-s3:latest .
18+
run: npm run test:component

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Claude Code Configuration
2+
3+
## Working Directory
4+
Always run commands from the project root directory (where this CLAUDE.md file is located).

package-lock.json

Lines changed: 1635 additions & 9544 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
"jest-environment-jsdom": "^29.7.0",
9292
"jsdom": "~22.1.0",
9393
"madge": "^8.0.0",
94-
"mocha-ibutsu-reporter": "^0.0.2",
9594
"mutation-observer": "^1.0.3",
9695
"ngx-deploy-npm": "^8.3.1",
9796
"nx": "20.8.0",

packages/components/cypres.config.ts renamed to packages/components/cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ export default defineConfig({
1414
...presets.devServer,
1515
webpackConfig,
1616
},
17-
},
17+
}
1818
});

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"react-router-dom": "^5.0.0 || ^6.0.0"
3838
},
3939
"dependencies": {
40+
"@patternfly/react-component-groups": "^6.0.0",
4041
"@redhat-cloud-services/frontend-components-utilities": "^7.0.0",
4142
"@redhat-cloud-services/types": "^3.0.0",
42-
"@patternfly/react-component-groups": "^6.0.0",
4343
"@scalprum/core": "^0.8.1",
4444
"@scalprum/react-core": "^0.9.1",
4545
"classnames": "^2.2.5",

packages/components/project.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@
7070
"test:component": {
7171
"executor": "@nx/cypress:cypress",
7272
"options": {
73-
"cypressConfig": "packages/components/cypres.config.ts",
74-
"tsConfig": "packages/components/tsconfig.cy.json",
75-
"devServerTarget": "my-react-app:build",
73+
"cypressConfig": "packages/components/cypress.config.ts",
7674
"testingType": "component",
7775
"skipServe": true
7876
}

packages/config/src/lib/addPrefixToContent.test.ts

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
import addPrefixToContent from './addPrefixToContent';
2+
import { words } from 'lodash';
23

3-
expect.extend({
4-
toEqualIgnoringWhitespace(received, expected) {
5-
const normalize = (str: string) => str.replace(/\s+/g, '');
6-
const pass = normalize(received) === normalize(expected);
7-
8-
if (pass) {
9-
return {
10-
message: () => `expected ${received} not to equal (ignoring whitespace) ${expected}`,
11-
pass: true,
12-
};
13-
} else {
14-
return {
15-
message: () => `expected ${received} to equal (ignoring whitespace) ${expected}`,
16-
pass: false,
17-
};
18-
}
19-
},
20-
});
214

225
describe('shouldnt prefix nested selectors', () => {
236
test('should add prefix above content', () => {
@@ -34,14 +17,14 @@ describe('shouldnt prefix nested selectors', () => {
3417
}
3518
}
3619
}`;
37-
expect(addPrefixToContent(content, prefix)).toEqualIgnoringWhitespace(output);
20+
expect(words(addPrefixToContent(content, prefix))).toEqual(words(output));
3821
});
3922

4023
test('should handle multiple top-level selectors in one string', () => {
4124
const content = `.learningResources-learningResources{overflow-y:auto}.widget-learning-resources{column-width:300px}`;
4225
const prefix = '.learningResources, .learning-resources';
4326
const output = `.learningResources, .learning-resources { .learningResources-learningResources {overflow-y:auto}}.learningResources, .learning-resources { .widget-learning-resources {column-width:300px}}`;
44-
expect(addPrefixToContent(content, prefix)).toEqualIgnoringWhitespace(output);
27+
expect(words(addPrefixToContent(content, prefix))).toEqual(words(output));
4528
});
4629

4730
test('should ignore nested selector containing prefix', () => {
@@ -61,7 +44,7 @@ describe('shouldnt prefix nested selectors', () => {
6144
}
6245
}
6346
}`;
64-
expect(addPrefixToContent(content, prefix)).toEqualIgnoringWhitespace(output);
47+
expect(words(addPrefixToContent(content, prefix))).toEqual(words(output));
6548
});
6649

6750
test('should handle deeply nested selectors with various properties and pseudo-classes', () => {
@@ -170,6 +153,6 @@ describe('shouldnt prefix nested selectors', () => {
170153
}
171154
}
172155
`;
173-
expect(addPrefixToContent(content, prefix)).toEqualIgnoringWhitespace(output);
156+
expect(words(addPrefixToContent(content, prefix))).toEqual(words(output));
174157
});
175158
});

0 commit comments

Comments
 (0)