Default Slot Content
', + }, + }); + + expect(wrapper.html()).toContain('Default Slot Content
'); + }); + + it('renders footer slot when showFooter is true', () => { + const wrapper = mount(Page, { + props: { + showFooter: true, + }, + slots: { + footer: 'Footer Slot Content
', + }, + }); + + expect(wrapper.html()).toContain('Footer Slot Content
'); + }); + + it('applies the custom contentClass', () => { + const wrapper = mount(Page, { + props: { + contentClass: 'custom-class', + }, + }); + + const contentDiv = wrapper.find('.p-4'); + expect(contentDiv.classes()).toContain('custom-class'); + }); + + it('does not render title slot if title prop is provided', () => { + const wrapper = mount(Page, { + props: { + title: 'Test Title', + }, + slots: { + title: 'Title Slot Content
', + }, + }); + + expect(wrapper.text()).toContain('Title Slot Content'); + expect(wrapper.html()).not.toContain('Test Title'); + }); + + it('does not render description slot if description prop is provided', () => { + const wrapper = mount(Page, { + props: { + description: 'Test Description', + }, + slots: { + description: 'Description Slot Content
', + }, + }); + + expect(wrapper.text()).toContain('Description Slot Content'); + expect(wrapper.html()).not.toContain('Test Description'); + }); +}); diff --git a/packages/ui/certd-client/src/vben/common-ui/components/page/index.ts b/packages/ui/certd-client/src/vben/common-ui/components/page/index.ts new file mode 100644 index 000000000..fd9e02f22 --- /dev/null +++ b/packages/ui/certd-client/src/vben/common-ui/components/page/index.ts @@ -0,0 +1,2 @@ +export { default as Page } from './page.vue'; +export * from './types'; diff --git a/packages/ui/certd-client/src/vben/common-ui/components/page/page.vue b/packages/ui/certd-client/src/vben/common-ui/components/page/page.vue new file mode 100644 index 000000000..557336bce --- /dev/null +++ b/packages/ui/certd-client/src/vben/common-ui/components/page/page.vue @@ -0,0 +1,105 @@ + + + ++ {{ description }} +
++ + {{ name }} + + {{ description }} +
+ +
+
+
+ {{ item.title }} +
+ + ++ {{ item.title }} +
+ + ++ {{ titleText }} +
++ {{ descText }} +
+