Skip to content

Commit b4d4514

Browse files
committed
Fix
1 parent 8ace9b1 commit b4d4514

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

packages/twenty-front/src/modules/ui/layout/dropdown/hooks/__tests__/useCloseAnyOpenDropdown.test.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ const Wrapper = ({ children }: { children: React.ReactNode }) => {
2727
};
2828

2929
describe('useCloseAnyOpenDropdown', () => {
30+
beforeEach(() => {
31+
jotaiStore.set(
32+
isDropdownOpenComponentState.atomFamily({ instanceId: dropdownId }),
33+
false,
34+
);
35+
});
36+
3037
it('should open dropdown and then close it with closeAnyOpenDropdown', async () => {
3138
const { result } = renderHook(
3239
() => {

packages/twenty-front/src/modules/ui/layout/dropdown/hooks/__tests__/useCloseDropdown.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ const Wrapper = ({ children }: { children: React.ReactNode }) => {
3131
};
3232

3333
describe('useCloseDropdown', () => {
34+
beforeEach(() => {
35+
jotaiStore.set(
36+
isDropdownOpenComponentState.atomFamily({ instanceId: dropdownId }),
37+
false,
38+
);
39+
jotaiStore.set(
40+
isDropdownOpenComponentState.atomFamily({
41+
instanceId: outsideDropdownId,
42+
}),
43+
false,
44+
);
45+
});
46+
3447
it('should close dropdown from inside component instance context', async () => {
3548
const { result } = renderHook(
3649
() => {

packages/twenty-front/src/modules/ui/layout/dropdown/hooks/__tests__/useOpenDropdown.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ const Wrapper = ({ children }: { children: React.ReactNode }) => {
3030
};
3131

3232
describe('useOpenDropdown', () => {
33+
beforeEach(() => {
34+
jotaiStore.set(
35+
isDropdownOpenComponentState.atomFamily({ instanceId: dropdownId }),
36+
false,
37+
);
38+
jotaiStore.set(
39+
isDropdownOpenComponentState.atomFamily({
40+
instanceId: outsideDropdownId,
41+
}),
42+
false,
43+
);
44+
});
45+
3346
it('should open dropdown from inside component instance context', async () => {
3447
const { result } = renderHook(
3548
() => {

packages/twenty-front/src/modules/ui/layout/dropdown/hooks/__tests__/useToggleDropdown.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ const Wrapper = ({ children }: { children: React.ReactNode }) => {
3030
};
3131

3232
describe('useToggleDropdown', () => {
33+
beforeEach(() => {
34+
jotaiStore.set(
35+
isDropdownOpenComponentState.atomFamily({ instanceId: dropdownId }),
36+
false,
37+
);
38+
jotaiStore.set(
39+
isDropdownOpenComponentState.atomFamily({
40+
instanceId: outsideDropdownId,
41+
}),
42+
false,
43+
);
44+
});
45+
3346
it('should toggle dropdown from inside component instance context', async () => {
3447
const { result } = renderHook(
3548
() => {

0 commit comments

Comments
 (0)