AUXteam commited on
Commit
da078b6
·
verified ·
1 Parent(s): 98e205f

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. App.tsx +1 -0
  2. package-lock.json +5 -2
  3. package.json +2 -2
  4. server.cjs +11 -2
  5. verify_features.spec.ts +1 -2
App.tsx CHANGED
@@ -1,5 +1,6 @@
1
 
2
  import React, { useState, useEffect } from 'react';
 
3
  import Navbar from './components/Navbar';
4
  import Hero from './components/Hero';
5
  import TrustedBy from './components/TrustedBy';
 
1
 
2
  import React, { useState, useEffect } from 'react';
3
+ import { X } from 'lucide-react';
4
  import Navbar from './components/Navbar';
5
  import Hero from './components/Hero';
6
  import TrustedBy from './components/TrustedBy';
package-lock.json CHANGED
@@ -13,7 +13,6 @@
13
  "cookie-parser": "^1.4.7",
14
  "express": "^5.2.1",
15
  "lucide-react": "^0.555.0",
16
- "playwright": "^1.58.2",
17
  "plotly.js": "2.30.0",
18
  "react": "^19.2.0",
19
  "react-dom": "^19.2.0",
@@ -22,9 +21,10 @@
22
  "vite-plugin-node-polyfills": "^0.25.0"
23
  },
24
  "devDependencies": {
25
- "@playwright/test": "^1.58.2",
26
  "@types/node": "^22.14.0",
27
  "@vitejs/plugin-react": "^5.0.0",
 
28
  "typescript": "~5.8.2",
29
  "vite": "^6.2.0"
30
  }
@@ -4931,6 +4931,7 @@
4931
  "version": "1.58.2",
4932
  "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz",
4933
  "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==",
 
4934
  "license": "Apache-2.0",
4935
  "dependencies": {
4936
  "playwright-core": "1.58.2"
@@ -4949,6 +4950,7 @@
4949
  "version": "1.58.2",
4950
  "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz",
4951
  "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==",
 
4952
  "license": "Apache-2.0",
4953
  "bin": {
4954
  "playwright-core": "cli.js"
@@ -4961,6 +4963,7 @@
4961
  "version": "2.3.2",
4962
  "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
4963
  "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
 
4964
  "hasInstallScript": true,
4965
  "license": "MIT",
4966
  "optional": true,
 
13
  "cookie-parser": "^1.4.7",
14
  "express": "^5.2.1",
15
  "lucide-react": "^0.555.0",
 
16
  "plotly.js": "2.30.0",
17
  "react": "^19.2.0",
18
  "react-dom": "^19.2.0",
 
21
  "vite-plugin-node-polyfills": "^0.25.0"
22
  },
23
  "devDependencies": {
24
+ "@playwright/test": "^1.51.0",
25
  "@types/node": "^22.14.0",
26
  "@vitejs/plugin-react": "^5.0.0",
27
+ "playwright": "^1.51.0",
28
  "typescript": "~5.8.2",
29
  "vite": "^6.2.0"
30
  }
 
4931
  "version": "1.58.2",
4932
  "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz",
4933
  "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==",
4934
+ "dev": true,
4935
  "license": "Apache-2.0",
4936
  "dependencies": {
4937
  "playwright-core": "1.58.2"
 
4950
  "version": "1.58.2",
4951
  "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz",
4952
  "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==",
4953
+ "dev": true,
4954
  "license": "Apache-2.0",
4955
  "bin": {
4956
  "playwright-core": "cli.js"
 
4963
  "version": "2.3.2",
4964
  "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
4965
  "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
4966
+ "dev": true,
4967
  "hasInstallScript": true,
4968
  "license": "MIT",
4969
  "optional": true,
package.json CHANGED
@@ -14,7 +14,6 @@
14
  "cookie-parser": "^1.4.7",
15
  "express": "^5.2.1",
16
  "lucide-react": "^0.555.0",
17
- "playwright": "^1.58.2",
18
  "plotly.js": "2.30.0",
19
  "react": "^19.2.0",
20
  "react-dom": "^19.2.0",
@@ -23,9 +22,10 @@
23
  "vite-plugin-node-polyfills": "^0.25.0"
24
  },
25
  "devDependencies": {
26
- "@playwright/test": "^1.58.2",
27
  "@types/node": "^22.14.0",
28
  "@vitejs/plugin-react": "^5.0.0",
 
29
  "typescript": "~5.8.2",
30
  "vite": "^6.2.0"
31
  }
 
14
  "cookie-parser": "^1.4.7",
15
  "express": "^5.2.1",
16
  "lucide-react": "^0.555.0",
 
17
  "plotly.js": "2.30.0",
18
  "react": "^19.2.0",
19
  "react-dom": "^19.2.0",
 
22
  "vite-plugin-node-polyfills": "^0.25.0"
23
  },
24
  "devDependencies": {
25
+ "@playwright/test": "^1.51.0",
26
  "@types/node": "^22.14.0",
27
  "@vitejs/plugin-react": "^5.0.0",
28
+ "playwright": "^1.51.0",
29
  "typescript": "~5.8.2",
30
  "vite": "^6.2.0"
31
  }
server.cjs CHANGED
@@ -155,7 +155,12 @@ app.get('/api/logout', (req, res) => {
155
  });
156
 
157
  app.post('/api/save-data', (req, res) => {
158
- const { type, data, user } = req.body;
 
 
 
 
 
159
  const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
160
  const filename = `${user}_${type}_${timestamp}.json`;
161
  const dirPath = path.join(__dirname, 'data');
@@ -177,9 +182,13 @@ app.post('/api/save-data', (req, res) => {
177
  });
178
 
179
  app.get('/api/list-data', (req, res) => {
180
- const { type, user } = req.query;
181
  const dirPath = path.join(__dirname, 'data');
182
 
 
 
 
 
183
  if (!fs.existsSync(dirPath)) {
184
  return res.json([]);
185
  }
 
155
  });
156
 
157
  app.post('/api/save-data', (req, res) => {
158
+ let { type, data, user } = req.body;
159
+
160
+ // Sanitize inputs to prevent path traversal
161
+ user = String(user).replace(/[^a-z0-9]/gi, '_');
162
+ type = String(type).replace(/[^a-z0-9]/gi, '_');
163
+
164
  const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
165
  const filename = `${user}_${type}_${timestamp}.json`;
166
  const dirPath = path.join(__dirname, 'data');
 
182
  });
183
 
184
  app.get('/api/list-data', (req, res) => {
185
+ let { type, user } = req.query;
186
  const dirPath = path.join(__dirname, 'data');
187
 
188
+ // Sanitize inputs
189
+ if (user) user = String(user).replace(/[^a-z0-9]/gi, '_');
190
+ if (type) type = String(type).replace(/[^a-z0-9]/gi, '_');
191
+
192
  if (!fs.existsSync(dirPath)) {
193
  return res.json([]);
194
  }
verify_features.spec.ts CHANGED
@@ -8,7 +8,6 @@ test('Verify app features', async ({ page }) => {
8
  await page.waitForSelector('text=Branding Content Testing');
9
 
10
  // 1. Verify Default View is Job Title
11
- // The first select is Focus Group, the second is Current View
12
  const currentView = await page.locator('select').nth(1).inputValue();
13
  console.log('Current View:', currentView);
14
  expect(currentView).toBe('Job Title');
@@ -48,7 +47,7 @@ test('Verify app features', async ({ page }) => {
48
  console.log('/health status:', response.status());
49
 
50
  // Take a screenshot of the chat page
51
- await page.screenshot({ path: 'chat_page_check.png', fullPage: true });
52
 
53
  console.log('Verification completed successfully');
54
  });
 
8
  await page.waitForSelector('text=Branding Content Testing');
9
 
10
  // 1. Verify Default View is Job Title
 
11
  const currentView = await page.locator('select').nth(1).inputValue();
12
  console.log('Current View:', currentView);
13
  expect(currentView).toBe('Job Title');
 
47
  console.log('/health status:', response.status());
48
 
49
  // Take a screenshot of the chat page
50
+ await page.screenshot({ path: '/home/jules/verification/chat_page_check.png', fullPage: true });
51
 
52
  console.log('Verification completed successfully');
53
  });