diff --git a/packages/web-react/src/components/Drawer/__tests__/Modal.test.tsx b/packages/web-react/src/components/Drawer/__tests__/Drawer.test.tsx
similarity index 56%
rename from packages/web-react/src/components/Drawer/__tests__/Modal.test.tsx
rename to packages/web-react/src/components/Drawer/__tests__/Drawer.test.tsx
index e3305c0e10..8b46566ae5 100644
--- a/packages/web-react/src/components/Drawer/__tests__/Modal.test.tsx
+++ b/packages/web-react/src/components/Drawer/__tests__/Drawer.test.tsx
@@ -4,28 +4,28 @@ import React from 'react';
import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest';
import { restPropsTest } from '../../../../tests/providerTests/restPropsTest';
import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest';
-import { SpiritModalProps } from '../../../types';
-import Modal from '../Modal';
+import { SpiritDrawerProps } from '../../../types';
+import Drawer from '../Drawer';
-describe('Modal', () => {
- const ModalTest = (props: SpiritModalProps) => (
- null}>
+describe('Drawer', () => {
+ const DrawerTest = (props: SpiritDrawerProps) => (
+ null}>
Test
-
+
);
- classNamePrefixProviderTest(ModalTest, 'Modal');
+ classNamePrefixProviderTest(DrawerTest, 'Drawer');
- stylePropsTest(ModalTest);
+ stylePropsTest(DrawerTest);
- restPropsTest(ModalTest, 'dialog');
+ restPropsTest(DrawerTest, 'dialog');
- it('should not close modal dialog', () => {
+ it('should not close drawer dialog', () => {
const mockedOnClose = jest.fn();
render(
-
+
Test
- ,
+ ,
);
const dialog = screen.getByRole('dialog');
@@ -34,12 +34,12 @@ describe('Modal', () => {
expect(mockedOnClose).not.toHaveBeenCalled();
});
- it('should close modal dialog', () => {
+ it('should close drawer dialog', () => {
const mockedOnClose = jest.fn();
render(
-
+
Test
- ,
+ ,
);
const dialog = screen.getByRole('dialog');
diff --git a/packages/web-react/src/components/Drawer/__tests__/useDrawerStyleProps.test.ts b/packages/web-react/src/components/Drawer/__tests__/useDrawerStyleProps.test.ts
new file mode 100644
index 0000000000..1655bbe81a
--- /dev/null
+++ b/packages/web-react/src/components/Drawer/__tests__/useDrawerStyleProps.test.ts
@@ -0,0 +1,18 @@
+import { renderHook } from '@testing-library/react';
+import { useDrawerStyleProps } from '../useDrawerStyleProps';
+
+describe('useDrawerStyleProps', () => {
+ it('should return defaults', () => {
+ const { result } = renderHook(() => useDrawerStyleProps({}));
+
+ expect(result.current.classProps.root).toBe('Drawer');
+ expect(result.current.classProps.dialog).toBe('DrawerDialog');
+ });
+
+ it('should return custom alignment', () => {
+ const { result } = renderHook(() => useDrawerStyleProps({ drawerAlignment: 'left' }));
+
+ expect(result.current.classProps.root).toBe('Drawer Drawer--left');
+ expect(result.current.classProps.dialog).toBe('DrawerDialog');
+ });
+});
diff --git a/packages/web-react/src/components/Drawer/__tests__/useModalStyleProps.test.ts b/packages/web-react/src/components/Drawer/__tests__/useModalStyleProps.test.ts
deleted file mode 100644
index 18d1c62e26..0000000000
--- a/packages/web-react/src/components/Drawer/__tests__/useModalStyleProps.test.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { renderHook } from '@testing-library/react';
-import { useModalStyleProps } from '../useModalStyleProps';
-
-describe('useModalStyleProps', () => {
- it('should return defaults', () => {
- const { result } = renderHook(() => useModalStyleProps({}));
-
- expect(result.current.classProps.root).toBe('Modal Modal--center');
- expect(result.current.classProps.dialog).toBe('ModalDialog');
- expect(result.current.classProps.title).toBe('ModalHeader__title');
- expect(result.current.classProps.header).toBe('ModalHeader');
- expect(result.current.classProps.body).toBe('ModalBody');
- expect(result.current.classProps.footer.root).toBe('ModalFooter ModalFooter--right');
- expect(result.current.classProps.footer.description).toBe('ModalFooter__description');
- expect(result.current.classProps.footer.actions).toBe('ModalFooter__actions');
- });
-});
diff --git a/packages/web-react/src/types/drawer.ts b/packages/web-react/src/types/drawer.ts
index 7662023599..3c187296da 100644
--- a/packages/web-react/src/types/drawer.ts
+++ b/packages/web-react/src/types/drawer.ts
@@ -44,7 +44,7 @@ export interface DrawerBaseProps
extends Omit,
DrawerDialogHandlingProps,
ChildrenProps {
- alignment: AlignmentXDictionaryType;
+ alignment?: AlignmentXDictionaryType;
id: string;
}