Skip to content

Commit 561ba81

Browse files
authored
chore: miscellaneous fixes (#4008)
1 parent b537e86 commit 561ba81

File tree

7 files changed

+2
-98
lines changed

7 files changed

+2
-98
lines changed

cypress.config.ts

-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ export default defineConfig({
1010
viewportHeight: 1260,
1111
viewportWidth: 1600,
1212
e2e: {
13-
// We've imported your old cypress plugins here.
14-
// You may want to clean this up later by importing these.
15-
setupNodeEvents(on, config) {
16-
// eslint-disable-next-line global-require,@typescript-eslint/no-var-requires
17-
return require('./test/plugins/index.js')(on, config);
18-
},
1913
baseUrl: 'http://localhost:6060/#',
2014
specPattern: 'test/integration/**/*.cy.{js,jsx,ts,tsx}',
2115
supportFile: 'test/support/index.js',

devin_lifeguard.yaml

-54
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"copy:styles": "copyfiles './src/**/*.scss' es --up 1",
6161
"cy:open": "yarn cy:wait; yarn cypress open",
6262
"cy:run": "yarn cy:wait; yarn cypress run --spec \"test/integration/**/*.cy.js\"",
63-
"cy:wait": "wait-on http-get://127.0.0.1:6060/#",
63+
"cy:wait": "wait-on http-get://localhost:6060/#",
6464
"lint": "npm-run-all lint:*",
6565
"lint:js": "eslint --max-warnings=0 .",
6666
"lint:ts": "tsc",

src/elements/common/content-answers/__mocks__/mocks.ts

-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { ANSWER_ERROR, QuestionType } from '@box/box-ai-content-answers';
22

3-
export const mockCurrentUser = {
4-
id: '123',
5-
name: 'g w',
6-
};
7-
83
export const mockFile = {
94
id: '123',
105
name: 'filename',
@@ -44,11 +39,6 @@ export const mockApi = {
4439
data: mockQuestionsWithAnswer[0],
4540
}),
4641
}),
47-
getUsersAPI: jest.fn().mockReturnValue({
48-
getUser: jest.fn().mockReturnValue({
49-
data: mockCurrentUser,
50-
}),
51-
}),
5242
};
5343

5444
export const mockApiReturnError = {
@@ -57,9 +47,4 @@ export const mockApiReturnError = {
5747
throw new Error('error');
5848
}),
5949
}),
60-
getUsersAPI: jest.fn().mockReturnValue({
61-
getUser: jest.fn().mockReturnValue({
62-
data: mockCurrentUser,
63-
}),
64-
}),
6550
};

src/elements/common/content-answers/__tests__/ContentAnswers.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { mockApi, mockFile } from '../__mocks__/mocks';
99
import APIContext from '../../api-context';
1010

1111
describe('elements/common/content-answers/ContentAnswers', () => {
12-
const renderComponent = (props?: {}) =>
12+
const renderComponent = (props = {}) =>
1313
render(
1414
<Notification.Provider>
1515
<Notification.Viewport />

src/elements/common/content-answers/__tests__/ContentAnswersModal.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import ContentAnswersModal from '../ContentAnswersModal';
88
import {
99
mockApi,
1010
mockApiReturnError,
11-
mockCurrentUser,
1211
mockFile,
1312
mockQuestionsWithAnswer,
1413
mockQuestionsWithError,
@@ -24,7 +23,6 @@ describe('elements/common/content-answers/ContentAnswersModal', () => {
2423
<Notification.Viewport />
2524
<APIContext.Provider value={api}>
2625
<ContentAnswersModal
27-
currentUser={mockCurrentUser}
2826
file={mockFile}
2927
isOpen
3028
onRequestClose={jest.fn()}

test/plugins/index.js

-19
This file was deleted.

0 commit comments

Comments
 (0)