Skip to content

Commit

Permalink
feat: support vue file unit testing, add some components unit testing (
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb authored Aug 11, 2024
1 parent 517acad commit 3f9ce63
Show file tree
Hide file tree
Showing 53 changed files with 241 additions and 156 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
deploy-push-playground-ftp:
name: Deploy Push Ftp
name: Deploy Push Playground Ftp
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
local-dir: ./docs/.vitepress/dist/

deploy-push-antd-ftp:
name: Deploy Push Ftp
name: Deploy Push Antd Ftp
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
local-dir: ./apps/web-antd/dist/

deploy-push-ele-ftp:
name: Deploy Push Ftp
name: Deploy Push Element Ftp
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
local-dir: ./apps/web-ele/dist/

deploy-push-naive-ftp:
name: Deploy Push Ftp
name: Deploy Push Naive Ftp
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"@vben/turbo-run": "workspace:*",
"@vben/vite-config": "workspace:*",
"@vben/vsh": "workspace:*",
"@vitejs/plugin-vue": "^5.1.2",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"@vue/test-utils": "^2.4.6",
"autoprefixer": "^10.4.20",
"cross-env": "^7.0.3",
Expand All @@ -85,6 +87,7 @@
"unbuild": "^2.0.0",
"vite": "^5.4.0",
"vitest": "^2.0.5",
"vue": "^3.4.37",
"vue-tsc": "^2.0.29"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
AlertDialogHeader,
AlertDialog as AlertDialogRoot,
AlertDialogTitle,
} from '@vben-core/shadcn-ui/components/ui/alert-dialog';
} from '../ui/alert-dialog';
interface Props {
cancelText?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import type {
import { computed } from 'vue';
import {
Avatar,
AvatarFallback,
AvatarImage,
} from '@vben-core/shadcn-ui/components/ui/avatar';
import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar';
interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps {
alt?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { IBreadcrumb } from './interface';
import type { IBreadcrumb } from './types';
import { VbenIcon } from '../icon';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<script lang="ts" setup>
import type { IBreadcrumb } from './interface';
import type { IBreadcrumb } from './types';
import { ChevronDown } from '@vben-core/icons';
import { VbenIcon } from '../icon';
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from '@vben-core/shadcn-ui/components/ui/breadcrumb';
} from '../ui/breadcrumb';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@vben-core/shadcn-ui/components/ui/dropdown-menu';
import { VbenIcon } from '../icon';
} from '../ui/dropdown-menu';
interface Props {
breadcrumbs: IBreadcrumb[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as VbenBreadcrumb } from './breadcrumb.vue';
export { default as VbenBackgroundBreadcrumb } from './breadcrumb-background.vue';

export type * from './interface';
export type * from './types';
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
import { computed } from 'vue';
import { LoaderCircle } from '@vben-core/icons';
import {
type ButtonVariants,
buttonVariants,
} from '@vben-core/shadcn-ui/components/ui/button';
import { cn } from '@vben-core/shared';
import { Primitive, type PrimitiveProps } from 'radix-vue';
import { type ButtonVariants, buttonVariants } from '../ui/button';
interface Props extends PrimitiveProps {
class?: any;
disabled?: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script setup lang="ts">
import type { ButtonVariants } from '@vben-core/shadcn-ui/components/ui/button';
import type { ButtonVariants } from '../ui/button';
import { computed, useSlots } from 'vue';
import { VbenTooltip } from '@vben-core/shadcn-ui/components/tooltip';
import { cn } from '@vben-core/shared';
import { type PrimitiveProps } from 'radix-vue';
import { VbenTooltip } from '../tooltip';
import VbenButton from './button.vue';
interface Props extends PrimitiveProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
import { Checkbox } from '@vben-core/shadcn-ui/components/ui/checkbox';
import { useForwardPropsEmits } from 'radix-vue';
import { Checkbox } from '../ui/checkbox';
const props = defineProps<
{
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import type { IContextMenuItem } from './interface';
import { computed } from 'vue';
import { useForwardPropsEmits } from 'radix-vue';
import {
ContextMenu,
ContextMenuContent,
ContextMenuItem,
ContextMenuSeparator,
ContextMenuShortcut,
ContextMenuTrigger,
} from '@vben-core/shadcn-ui/components/ui/context-menu';
import { useForwardPropsEmits } from 'radix-vue';
} from '../ui/context-menu';
const props = defineProps<
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@vben-core/shadcn-ui/components/ui/dropdown-menu';
} from '../ui/dropdown-menu';
interface Props extends DropdownMenuProps {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@vben-core/shadcn-ui/components/ui/dropdown-menu';
} from '../ui/dropdown-menu';
interface Props extends DropdownMenuProps {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import type {
import { computed } from 'vue';
import { useForwardPropsEmits } from 'radix-vue';
import {
HoverCard,
HoverCardContent,
HoverCardTrigger,
} from '@vben-core/shadcn-ui/components/ui/hover-card';
import { useForwardPropsEmits } from 'radix-vue';
} from '../ui/hover-card';
interface Props extends HoverCardRootProps {
class?: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
import { ref, useSlots } from 'vue';
import { Eye, EyeOff } from '@vben-core/icons';
import {
type InputProps,
VbenInput,
} from '@vben-core/shadcn-ui/components/input';
import { useForwardProps } from 'radix-vue';
import { type InputProps, VbenInput } from '../input';
import PasswordStrength from './password-strength.vue';
interface Props extends InputProps {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as VbenInput } from './input.vue';
export type * from './interface';
export type * from './types';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { InputProps } from './interface';
import type { InputProps } from './types';
import { computed } from 'vue';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { default as VbenPinInput } from './input.vue';

export type * from './interface';
export type * from './types';
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<script setup lang="ts">
import type { PinInputProps } from './interface';
import type { PinInputProps } from './types';
import { computed, ref, watch } from 'vue';
import { VbenButton } from '@vben-core/shadcn-ui/components/button';
import {
PinInput,
PinInputGroup,
PinInputInput,
} from '@vben-core/shadcn-ui/components/ui/pin-input';
import { VbenButton } from '../button';
import { PinInput, PinInputGroup, PinInputInput } from '../ui/pin-input';
defineOptions({
inheritAttrs: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import type {
import { computed } from 'vue';
import { useForwardPropsEmits } from 'radix-vue';
import {
PopoverContent,
Popover as PopoverRoot,
PopoverTrigger,
} from '@vben-core/shadcn-ui/components/ui/popover';
import { useForwardPropsEmits } from 'radix-vue';
} from '../ui/popover';
interface Props extends PopoverRootProps {
class?: any;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<script setup lang="ts">
import { ref } from 'vue';
import {
ScrollArea,
ScrollBar,
} from '@vben-core/shadcn-ui/components/ui/scroll-area';
import { cn } from '@vben-core/shared';
import { ScrollArea, ScrollBar } from '../ui/scroll-area';
interface Props {
class?: any;
horizontal?: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export type * from './interface';

export { default as VbenSegmented } from './segmented.vue';

export type * from './types';
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
<script setup lang="ts">
import type { SegmentedItem } from './interface';
import type { SegmentedItem } from './types';
import { computed } from 'vue';
import {
Tabs,
TabsContent,
TabsList,
} from '@vben-core/shadcn-ui/components/ui/tabs';
import { TabsTrigger } from 'radix-vue';
import { Tabs, TabsContent, TabsList } from '../ui/tabs';
import TabsIndicator from './tabs-indicator.vue';
interface Props {
Expand Down
13 changes: 5 additions & 8 deletions packages/@core/ui-kit/shadcn-ui/src/components/sheet/sheet.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<script setup lang="ts">
import { computed, useSlots } from 'vue';
import {
VbenButton,
VbenIconButton,
} from '@vben-core/shadcn-ui/components/button';
import { VbenScrollbar } from '@vben-core/shadcn-ui/components/scrollbar';
import { X } from 'lucide-vue-next';
import { VbenButton, VbenIconButton } from '../button';
import { VbenScrollbar } from '../scrollbar';
import {
Sheet,
SheetClose,
Expand All @@ -15,9 +14,7 @@ import {
SheetHeader,
SheetTitle,
SheetTrigger,
} from '@vben-core/shadcn-ui/components/ui/sheet';
import { X } from 'lucide-vue-next';
} from '../ui/sheet';
interface Props {
cancelText?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from '@vben-core/shadcn-ui/components/ui/tooltip';
} from '../ui/tooltip';
interface Props {
contentClass?: any;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script setup lang="ts">
import { computed, type HTMLAttributes } from 'vue';
import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
import { cn } from '@vben-core/shared';
import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue';
import { buttonVariants } from '../button';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogActionProps
>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script setup lang="ts">
import { computed, type HTMLAttributes } from 'vue';
import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
import { cn } from '@vben-core/shared';
import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue';
import { buttonVariants } from '../button';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogCancelProps
>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script setup lang="ts">
import type { toggleVariants } from '@vben-core/shadcn-ui/components/ui/toggle';
import type { VariantProps } from 'class-variance-authority';
import type { toggleVariants } from '../toggle';
import { computed, type HTMLAttributes, provide } from 'vue';
import { cn } from '@vben-core/shared';
Expand Down
Loading

0 comments on commit 3f9ce63

Please sign in to comment.