Skip to content

Commit e3d4522

Browse files
committed
fix: tests and accountId var
1 parent 0ff77ed commit e3d4522

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
"eslint-plugin-react-hooks": "5.1.0",
109109
"globals": "^15.14.0",
110110
"husky": "9.1.7",
111-
"miragejs": "^0.1.48",
112111
"nock": "^13.5.6",
113112
"nyc": "17.1.0",
114113
"prettier": "3.4.2",

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (MOCK_API) {
3232
appContext: window.Cypress ? window.appContext : defaultMockContext,
3333
database: window.Cypress ? window.database : buildDatabase(mockMembers),
3434
},
35-
window.Cypress ? MockSolution.MirageJS : MockSolution.ServiceWorker,
35+
MockSolution.ServiceWorker,
3636
);
3737
}
3838

src/mocks/db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const defaultMockContext: LocalContext = {
4141
permission: PermissionLevel.Admin,
4242
context: 'builder',
4343
itemId: '1234-1234-123456-8123-123456',
44-
memberId: mockMembers[0].id,
44+
accountId: mockMembers[0].id,
4545
};
4646

4747
export const mockItem: DiscriminatedItem = {

src/modules/common/ChatbotPrompt.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,12 @@ const ChatbotPrompt = ({ id }: Props): JSX.Element | null => {
5858
name: SettingsKeys.General,
5959
});
6060
const generalSetting = generalSettings?.[0]?.data ?? DEFAULT_GENERAL_SETTINGS;
61-
let { memberId } = useLocalContext();
62-
if (id) {
63-
memberId = id;
64-
}
61+
const { accountId } = useLocalContext();
62+
6563
const [openEditor, setOpenEditor] = useState(false);
6664
const { mutate: postAction } = mutations.usePostAppAction();
6765

68-
const comments = appData?.filter((c) => c.creator?.id === memberId);
66+
const comments = appData?.filter((c) => c.creator?.id === (id ?? accountId));
6967

7068
const realChatbotPromptExists = comments?.find(
7169
(c) => c.data.chatbotPromptSettingId !== undefined,

yarn.lock

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8658,7 +8658,6 @@ __metadata:
86588658
lodash.flatten: "npm:^4.4.0"
86598659
lodash.groupby: "npm:^4.6.0"
86608660
lucide-react: "npm:^0.469.0"
8661-
miragejs: "npm:^0.1.48"
86628661
nock: "npm:^13.5.6"
86638662
nyc: "npm:17.1.0"
86648663
prettier: "npm:3.4.2"
@@ -11077,7 +11076,7 @@ __metadata:
1107711076
languageName: node
1107811077
linkType: hard
1107911078

11080-
"miragejs@npm:0.1.48, miragejs@npm:^0.1.48":
11079+
"miragejs@npm:0.1.48":
1108111080
version: 0.1.48
1108211081
resolution: "miragejs@npm:0.1.48"
1108311082
dependencies:

0 commit comments

Comments
 (0)