Skip to content

Commit

Permalink
fix(tabs): [tabs] modify tabs demo bug (#2274)
Browse files Browse the repository at this point in the history
* fix: modify tabs bug

* fix: modify e2e-test
  • Loading branch information
James-9696 authored Oct 16, 2024
1 parent 95854ea commit d22c32d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { ref } from 'vue'
import { Tabs as TinyTabs, TabItem as TinyTabItem } from '@opentiny/vue'
const activeName = ref('second')
const activeName = ref('first')
</script>

<style scoped>
Expand Down
11 changes: 8 additions & 3 deletions examples/sites/demos/pc/app/tabs/basic-usage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ test('基本用法', async ({ page }) => {
const activeBar = tabs.locator('.tiny-tabs__active-bar')

await expect(tabItems).toHaveCount(4)
await expect(tabItems).toHaveClass([/is-top/, /is-top is-active/, /is-top/, /is-top/])
await expect(content).toHaveText(/数据组件/)
await expect(tabItems).toHaveClass([
/tiny-tabs__item is-top is-active/,
/tiny-tabs__item is-top is-disabled/,
/tiny-tabs__item is-top/,
/tiny-tabs__item is-top/
])
await expect(content).toHaveText(/表单组件/)
await expect(activeBar).toHaveCSS('width', '64px')
await expect(activeBar).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 96, 0)')
await expect(activeBar).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 0, 0)')
await item1.click()
await expect(item1).toHaveClass(/is-active/)
await expect(activeBar).toHaveCSS('width', '64px')
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/tabs/basic-usage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
},
data() {
return {
activeName: 'second'
activeName: 'first'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<tiny-tab-item title="业务组件" name="fourth"> 业务组件,与业务紧密相关实现某种业务功能的组件集。 </tiny-tab-item>
</tiny-tabs>
<br /><br /><br /><br />
<tiny-tabs separator :editable="false" :with-add="true" @add="handleadd" style="width: 500px" show-more-tabs>
<tiny-tabs separator :editable="false" :with-add="true" @add="handleadd" style="width: 500px">
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
{{ item.content }}
</tiny-tab-item>
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/tabs/tabs-separator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<tiny-tab-item title="业务组件" name="fourth"> 业务组件,与业务紧密相关实现某种业务功能的组件集。 </tiny-tab-item>
</tiny-tabs>
<br /><br /><br /><br />
<tiny-tabs separator :editable="false" :with-add="true" @add="handleadd" style="width: 500px" show-more-tabs>
<tiny-tabs separator :editable="false" :with-add="true" @add="handleadd" style="width: 500px">
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
{{ item.content }}
</tiny-tab-item>
Expand Down

0 comments on commit d22c32d

Please sign in to comment.