Repository: IduxFE/components
Pull request #62 (2020-12-23 03:39:38)

feat(comp: divider): add divider component
link #32 

## PR Checklist

Please check if your PR fulfills the following requirements:

- [x] The commit message follows [our guidelines](https://github.com/IduxFE/components/blob/main/docs/contributing.zh.md#commit)
- [x] Tests for the changes have been added/updated or not needed
- [x] Docs and demo have been added/updated or not needed

## PR Type

What kind of change does this PR introduce?

- [ ] Bugfix
- [x] Feature
- [ ] Component style update
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Application (the showcase website) / infrastructure changes
- [ ] Other... Please describe:

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

## What is the new behavior?

## Other information


codecov[bot]: # [Codecov](https://codecov.io/gh/IduxFE/components/pull/62?src=pr&el=h1) Report
> Merging [#62](https://codecov.io/gh/IduxFE/components/pull/62?src=pr&el=desc) (4a239ea) into [main](https://codecov.io/gh/IduxFE/components/commit/298c78f3132b99d02aef2ada5c1e76a8aad0732c?el=desc) (298c78f) will **increase** coverage by `0.39%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/IduxFE/components/pull/62/graphs/tree.svg?width=650&height=150&src=pr&token=PGAUXP06V3)](https://codecov.io/gh/IduxFE/components/pull/62?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
+ Coverage   92.10%   92.50%   +0.39%     
==========================================
  Files          43       44       +1     
  Lines         342      360      +18     
  Branches       58       62       +4     
==========================================
+ Hits          315      333      +18     
  Misses         10       10              
  Partials       17       17              
```


| [Impacted Files](https://codecov.io/gh/IduxFE/components/pull/62?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [packages/components/core/config/useGlobalConfig.ts](https://codecov.io/gh/IduxFE/components/pull/62/diff?src=pr&el=tree#diff-cGFja2FnZXMvY29tcG9uZW50cy9jb3JlL2NvbmZpZy91c2VHbG9iYWxDb25maWcudHM=) | `100.00% <100.00%> (ø)` | |
| [packages/components/divider/src/Divider.vue](https://codecov.io/gh/IduxFE/components/pull/62/diff?src=pr&el=tree#diff-cGFja2FnZXMvY29tcG9uZW50cy9kaXZpZGVyL3NyYy9EaXZpZGVyLnZ1ZQ==) | `100.00% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/IduxFE/components/pull/62?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/IduxFE/components/pull/62?src=pr&el=footer). Last update [298c78f...4a239ea](https://codecov.io/gh/IduxFE/components/pull/62?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

LaamGinghong: @danranVm 麻烦安排review
danranVm: 经过我们其他的几个 reviewer 的讨论，建议去掉 `position` 的 `string` 类型，只支持 `left` `center` `right`

十分抱歉，:cry:
LaamGinghong: @danranVm @Pupils-web 麻烦重新review
danranVm: @LaamGinghong  感谢你的 PR, LGTM

Patch:
diff --git a/packages/components/components.less b/packages/components/components.less
index 41338dcc..bc8282c6 100644
--- a/packages/components/components.less
+++ b/packages/components/components.less
@@ -1,3 +1,4 @@
 @import './button/style/index.less';
 @import './icon/style/index.less';
 @import './badge/style/index.less';
+@import './divider/style/index.less';
diff --git a/packages/components/core/config/types.ts b/packages/components/core/config/types.ts
index bc90a15a..d4cec656 100644
--- a/packages/components/core/config/types.ts
+++ b/packages/components/core/config/types.ts
@@ -1,4 +1,4 @@
-import type { ComponentSize, ButtonMode } from '../types'
+import type { ComponentSize, ButtonMode, DividerPosition, DividerType } from '../types'
 
 export type GlobalConfigKey = keyof GlobalConfig
 
@@ -6,6 +6,7 @@ export interface GlobalConfig {
   button: ButtonConfig
   icon: IconConfig
   badge: BadgeConfig
+  divider: DividerConfig
 }
 
 export interface ButtonConfig {
@@ -22,3 +23,10 @@ export interface BadgeConfig {
   dot: boolean
   overflowCount: number | string
 }
+
+export interface DividerConfig {
+  dashed: boolean
+  plain: boolean
+  position: DividerPosition
+  type: DividerType
+}
diff --git a/packages/components/core/config/useGlobalConfig.ts b/packages/components/core/config/useGlobalConfig.ts
index 6360ad28..ad4b417a 100644
--- a/packages/components/core/config/useGlobalConfig.ts
+++ b/packages/components/core/config/useGlobalConfig.ts
@@ -1,21 +1,29 @@
 import { inject, shallowReactive, provide, readonly } from 'vue'
 import type { DeepReadonly } from 'vue'
-import type { BadgeConfig, ButtonConfig, GlobalConfig, GlobalConfigKey, IconConfig } from './types'
+import type { BadgeConfig, ButtonConfig, GlobalConfig, GlobalConfigKey, IconConfig, DividerConfig } from './types'
 
-const button: ButtonConfig = shallowReactive({ mode: 'default', size: 'medium' })
-const icon: IconConfig = shallowReactive({})
-const badge: BadgeConfig = shallowReactive({ showZero: false, dot: false, overflowCount: 99 })
+const button = shallowReactive<ButtonConfig>({ mode: 'default', size: 'medium' })
+const icon = shallowReactive<IconConfig>({})
+const badge = shallowReactive<BadgeConfig>({ showZero: false, dot: false, overflowCount: 99 })
+const divider = shallowReactive<DividerConfig>({
+  dashed: false,
+  plain: false,
+  position: 'center',
+  type: 'horizontal',
+})
 
 const defaultConfig: GlobalConfig = {
   button,
   icon,
   badge,
+  divider,
 }
 
 const globalConfigToken: Record<GlobalConfigKey, symbol> = {
   button: Symbol(),
   icon: Symbol(),
   badge: Symbol(),
+  divider: Symbol(),
 }
 
 /**
diff --git a/packages/components/core/types/index.ts b/packages/components/core/types/index.ts
index b3dea1d0..b3a02837 100644
--- a/packages/components/core/types/index.ts
+++ b/packages/components/core/types/index.ts
@@ -1,3 +1,7 @@
 export type ComponentSize = 'large' | 'medium' | 'small'
 
 export type ButtonMode = 'primary' | 'default' | 'dashed' | 'text' | 'link'
+
+export type DividerPosition = 'left' | 'center' | 'right'
+
+export type DividerType = 'horizontal' | 'vertical'
diff --git a/packages/components/divider/demo/horizontal.md b/packages/components/divider/demo/horizontal.md
new file mode 100644
index 00000000..3809088e
--- /dev/null
+++ b/packages/components/divider/demo/horizontal.md
@@ -0,0 +1,29 @@
+---
+order: 0
+title:
+  zh: 水平分割线
+  en: Horizontal divider
+---
+
+## zh
+
+默认为水平分割线，可在中间加入文字。
+
+## demo
+
+```html
+
+<template>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+  <ix-divider/>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+  <ix-divider dashed/>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+</template>
+```
diff --git a/packages/components/divider/demo/plain.md b/packages/components/divider/demo/plain.md
new file mode 100755
index 00000000..cb6da433
--- /dev/null
+++ b/packages/components/divider/demo/plain.md
@@ -0,0 +1,32 @@
+---
+order: 1
+title: 
+  zh: 分割线使用正文样式
+  en: divider text use plain style
+---
+
+## zh
+
+使用 `plain` 可以设置为更轻量的分割线文字样式。
+
+## demo
+
+```html
+<template>
+ <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+  <ix-divider plain>Text</ix-divider>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+  <ix-divider position="left" plain>Left Text</ix-divider>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+ <ix-divider position="right" plain>Right Text</ix-divider>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+</template>
+```
diff --git a/packages/components/divider/demo/vertical.md b/packages/components/divider/demo/vertical.md
new file mode 100755
index 00000000..1ce2befe
--- /dev/null
+++ b/packages/components/divider/demo/vertical.md
@@ -0,0 +1,22 @@
+---
+order: 3
+title:
+  zh: 垂直分割线
+  en: vertical divider
+---
+
+## zh
+
+使用 `type="vertical"`设置为行内的垂直分割线
+
+## demo
+
+```html
+<template>
+ Text
+  <ix-divider type="vertical" />
+  <a href="#">Link</a>
+  <ix-divider type="vertical"/>
+  <a href="#">Link</a>
+</template>
+```
diff --git a/packages/components/divider/demo/with-text.md b/packages/components/divider/demo/with-text.md
new file mode 100755
index 00000000..a8056e27
--- /dev/null
+++ b/packages/components/divider/demo/with-text.md
@@ -0,0 +1,34 @@
+---
+order: 2
+title: 
+  zh: 带文字的分割线
+  en: divider with text
+---
+
+## zh
+
+分割线中带有文字，可以用 `position` 制定文字的位置。
+
+文字默认位置为 `center`，除此之外你还可以设置为 `left` 和 `center`，同时你还可以通过全局配置修改默认位置。
+
+## demo
+
+```html
+<template>
+ <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+  <ix-divider>Text</ix-divider>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+  <ix-divider position="left">Left Text</ix-divider>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+ <ix-divider position="right">Right Text</ix-divider>
+  <p>
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
+  </p>
+</template>
+```
diff --git a/packages/components/divider/docs/index.zh.md b/packages/components/divider/docs/index.zh.md
new file mode 100644
index 00000000..8fa110bd
--- /dev/null
+++ b/packages/components/divider/docs/index.zh.md
@@ -0,0 +1,26 @@
+---
+category: components
+type: 通用
+title: Divider
+subtitle: 分割线
+cover:
+---
+
+区隔内容的分割线
+
+## 何时使用
+
+* 对不同章节的文本段落进行分割
+* 对行内文字/链接进行分割，例如表格的操作列
+
+## API
+
+### `ix-divider`
+
+| 属性 | 说明 | 类型 | 全局配置 | 默认值 | 备注 |
+| --- | :-- | --- | :-- | --- | --- |
+| `dashed` | 是否虚线 | boolean | false | - | - |
+| `plain` | 文字是否显示为普通正文样式 | boolean |false| - | - |
+| `position` | 文字显示位置 | `left`|`center`|`right` |`center`| - |-|
+| `type` | 水平分割线还是垂直分割线 | `horizontal`|`vertical` | - |`horizontal`|
+| `text` | 分割线显示文字 | `slot` |-| - | - |
diff --git a/packages/components/divider/index.ts b/packages/components/divider/index.ts
new file mode 100644
index 00000000..082d9b91
--- /dev/null
+++ b/packages/components/divider/index.ts
@@ -0,0 +1,7 @@
+import { installComponent } from '@idux/components/core/utils'
+import IxDivider from './src/Divider.vue'
+
+IxDivider.install = installComponent(IxDivider)
+
+export { IxDivider }
+export type { IxDividerComponent } from './src/types'
diff --git a/packages/components/divider/src/Divider.vue b/packages/components/divider/src/Divider.vue
new file mode 100644
index 00000000..c444d451
--- /dev/null
+++ b/packages/components/divider/src/Divider.vue
@@ -0,0 +1,57 @@
+<template>
+  <div class="ix-divider" :class="className">
+    <span v-if="$slots.default" class="ix-divider-inner-text">
+      <slot />
+    </span>
+  </div>
+</template>
+<script lang="ts">
+import type { PropType } from 'vue'
+import type { DividerConfig } from '@idux/components/core/config'
+import type { DividerPosition, DividerType } from '@idux/components/core/types'
+import type { DividerProps } from './types'
+
+import { computed, defineComponent } from 'vue'
+import { useGlobalConfig } from '@idux/components/core/config'
+
+export default defineComponent({
+  name: 'IxDivider',
+  props: {
+    dashed: { type: Boolean, default: undefined },
+    plain: { type: Boolean, default: undefined },
+    position: {
+      type: String as PropType<DividerPosition>,
+      default: undefined,
+    },
+    type: {
+      type: String as PropType<DividerType>,
+      default: undefined,
+    },
+  },
+  setup(props: DividerProps, { slots }) {
+    const dividerConfig = useGlobalConfig('divider')
+    const className = useClassName(props, dividerConfig, !!slots.default)
+
+    return { className }
+  },
+})
+
+function useClassName(props: DividerProps, config: DividerConfig, withText: boolean) {
+  return computed(() => {
+    const position = props.position || config.position
+    const type = props.type || config.type
+    const dashed = props.dashed || config.dashed
+    const plain = props.plain || config.plain
+
+    return [
+      `ix-divider-${type}`,
+      {
+        'ix-divider-with-text': withText,
+        'ix-divider-dashed': dashed,
+        'ix-divider-plain': plain && withText,
+        [`ix-divider-with-text-${position}`]: type === 'horizontal' && withText,
+      },
+    ]
+  })
+}
+</script>
diff --git a/packages/components/divider/src/types.ts b/packages/components/divider/src/types.ts
new file mode 100644
index 00000000..d96c7c2a
--- /dev/null
+++ b/packages/components/divider/src/types.ts
@@ -0,0 +1,15 @@
+import type { DividerPosition, DividerType } from '@idux/components/core/types'
+
+export interface DividerProps {
+  /* dashed divider */
+  dashed?: boolean
+  /* common text style */
+  plain?: boolean
+  /* position of the text */
+  position?: DividerPosition
+  /* horizontal divider or vertical divider */
+  type?: DividerType
+}
+
+// eslint-disable-next-line @typescript-eslint/no-empty-interface
+export interface IxDividerComponent extends DividerProps {}
diff --git a/packages/components/divider/style/index.less b/packages/components/divider/style/index.less
new file mode 100644
index 00000000..c5f3ab7e
--- /dev/null
+++ b/packages/components/divider/style/index.less
@@ -0,0 +1,78 @@
+@import '../../style/default.less';
+
+@divider-prefix: ~'@{idux-prefix}-divider';
+
+.@{divider-prefix} {
+  border-top: @border-size-sm solid @border-color;
+
+  &-horizontal {
+    width: 100%;
+    min-width: 100%;
+    margin: @margin-xl 0;
+    clear: both;
+
+    &.@{divider-prefix}-with-text {
+      position: relative;
+
+      .@{divider-prefix}-inner-text {
+        position: absolute;
+        display: inline-block;
+        padding: 0 1em;
+        font-size: @font-size-lg;
+        color: @black;
+        font-weight: @font-weight-md;
+        background: @white;
+        top: 50%;
+        transform: translateY(-50%);
+      }
+
+      @divider-prefix-with-text: ~'@{divider-prefix}-with-text';
+
+      &.@{divider-prefix-with-text}-center {
+        .@{divider-prefix}-inner-text {
+          left: 50%;
+          transform: translate(-50%, -50%);
+        }
+      }
+
+      &.@{divider-prefix-with-text}-left {
+        .@{divider-prefix}-inner-text {
+          left: 5%;
+        }
+      }
+
+      &.@{divider-prefix-with-text}-right {
+        .@{divider-prefix}-inner-text {
+          right: 5%;
+        }
+      }
+
+      &.@{divider-prefix}-plain {
+        .@{divider-prefix}-inner-text {
+          font-size: @font-size-md;
+          font-weight: @font-weight-sm;
+        }
+      }
+    }
+  }
+
+  &-vertical {
+    top: -0.06em;
+    display: inline-block;
+    height: 0.9em;
+    vertical-align: middle;
+    border-top: 0;
+    border-left: @border-size-sm solid @border-color;
+    margin: 0 @margin-sm;
+
+    &.@{divider-prefix}-dashed {
+      border-width: 0 0 0 1px;
+    }
+  }
+
+  &-dashed {
+    border-style: dashed;
+    border-width: 1px 0 0;
+    background: none;
+  }
+}
diff --git a/packages/components/index.ts b/packages/components/index.ts
index ee5e62b0..b92b7540 100644
--- a/packages/components/index.ts
+++ b/packages/components/index.ts
@@ -2,8 +2,9 @@ import type { App } from 'vue'
 import { IxButton, IxButtonGroup } from './button'
 import { IxIcon } from './icon'
 import { IxBadge } from './badge'
+import { IxDivider } from './divider'
 
-const components = [IxButton, IxButtonGroup, IxIcon, IxBadge]
+const components = [IxButton, IxButtonGroup, IxIcon, IxBadge, IxDivider]
 
 const install = (app: App): void => {
   components.forEach(component => {
@@ -25,3 +26,4 @@ export * from './button'
 export * from './i18n'
 export * from './icon'
 export * from './badge'
+export * from './divider'
diff --git a/tsconfig.json b/tsconfig.json
index 1f499496..6d11a142 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -7,7 +7,6 @@
     "target": "ES6",
     "moduleResolution": "node",
     "jsx": "preserve",
-
     "sourceMap": true,
     "declaration": true,
     "downlevelIteration": true,
@@ -15,14 +14,12 @@
     "esModuleInterop": true,
     "resolveJsonModule": true,
     "removeComments": true,
-
     "strict": true,
     "noUnusedLocals": true,
     "noImplicitReturns": true,
     "noFallthroughCasesInSwitch": true,
     "forceConsistentCasingInFileNames": true,
     "allowSyntheticDefaultImports": true,
-
     "paths": {
       "@idux": ["./packages"],
       "@idux/*": ["./packages/*"]


Test patch:
diff --git a/packages/components/divider/__tests__/__snapshots__/divider.spec.ts.snap b/packages/components/divider/__tests__/__snapshots__/divider.spec.ts.snap
new file mode 100644
index 00000000..43a3cd27
--- /dev/null
+++ b/packages/components/divider/__tests__/__snapshots__/divider.spec.ts.snap
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Divider.vue render work 1`] = `"<div class=\\"ix-divider ix-divider-horizontal\\"><!--v-if--></div>"`;
diff --git a/packages/components/divider/__tests__/divider.spec.ts b/packages/components/divider/__tests__/divider.spec.ts
new file mode 100644
index 00000000..1f4dfe8b
--- /dev/null
+++ b/packages/components/divider/__tests__/divider.spec.ts
@@ -0,0 +1,196 @@
+import { mount, MountingOptions, VueWrapper } from '@vue/test-utils'
+import { DefineComponent } from 'vue'
+import IxDivider from '../src/Divider.vue'
+import { DividerProps } from '../src/types'
+
+describe('Divider.vue', () => {
+  let DividerMount: (
+    options?: MountingOptions<Partial<DividerProps>>,
+  ) => VueWrapper<InstanceType<DefineComponent<DividerProps>>>
+
+  beforeEach(() => {
+    DividerMount = (options = {}) => {
+      return mount<DividerProps>(IxDivider, {
+        ...options,
+      })
+    }
+  })
+
+  test('render work', () => {
+    const wrapper = DividerMount()
+    expect(wrapper.html()).toMatchSnapshot()
+  })
+
+  test('type work', async () => {
+    const wrapper = DividerMount()
+    expect(wrapper.classes()).toContain('ix-divider-horizontal')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).toContain('ix-divider-horizontal')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).toContain('ix-divider-vertical')
+  })
+
+  test('dashed work', async () => {
+    const wrapper = DividerMount()
+    expect(wrapper.classes()).not.toContain('ix-divider-dashed')
+
+    await wrapper.setProps({ dashed: true })
+    expect(wrapper.classes()).toContain('ix-divider-dashed')
+
+    await wrapper.setProps({ dashed: false })
+    expect(wrapper.classes()).not.toContain('ix-divider-dashed')
+  })
+
+  test('slot work', async () => {
+    const text = 'Text'
+    let wrapper = DividerMount()
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text')
+    expect(wrapper.text()).not.toEqual(text)
+    expect(wrapper.find('.ix-divider-inner-text').exists()).toBeFalsy()
+
+    wrapper = DividerMount({ slots: { default: text } })
+    expect(wrapper.classes()).toContain('ix-divider-with-text')
+    expect(wrapper.text()).toEqual(text)
+    expect(wrapper.find('.ix-divider-inner-text').exists()).toBeTruthy()
+  })
+
+  test('plain work', async () => {
+    const text = 'Text'
+    let wrapper = DividerMount()
+    expect(wrapper.classes()).not.toContain('ix-divider-plain')
+
+    wrapper = DividerMount({ slots: { default: text } })
+    expect(wrapper.classes()).not.toContain('ix-divider-plain')
+
+    await wrapper.setProps({ plain: true })
+    expect(wrapper.classes()).toContain('ix-divider-plain')
+
+    await wrapper.setProps({ plain: false })
+    expect(wrapper.classes()).not.toContain('ix-divider-plain')
+  })
+
+  test('position work', async () => {
+    const text = 'Text'
+    let wrapper = DividerMount()
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    wrapper = DividerMount({ slots: { default: text } })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    wrapper = DividerMount({ slots: { default: text }, props: { position: 'left' } })
+    expect(wrapper.classes()).toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    wrapper = DividerMount({ props: { position: 'left' } })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    wrapper = DividerMount({ slots: { default: text }, props: { position: 'center' } })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    wrapper = DividerMount({ props: { position: 'center' } })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    wrapper = DividerMount({ slots: { default: text }, props: { position: 'right' } })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    wrapper = DividerMount({ props: { position: 'right' } })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'horizontal' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+
+    await wrapper.setProps({ type: 'vertical' })
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-left')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-center')
+    expect(wrapper.classes()).not.toContain('ix-divider-with-text-right')
+  })
+})