Skip to content

Commit 3d32cdb

Browse files
committed
test(table): dataSource为空,表头checkbox状态应为空
1 parent 6168d3b commit 3d32cdb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

packages/component/component/table/__tests__/table.test.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,4 +798,29 @@ describe("LayTable", () => {
798798
expect(thS[0].text()).toBe('titleSlot1')
799799
expect(thS[1].text()).toBe('titleSlot2')
800800
});
801+
802+
test("dataSource为空,表头checkbox状态应为空", async () => {
803+
const columns = [
804+
{ type: 'checkbox', title: 'title', key: 'id'},
805+
];
806+
807+
const dataSource = ref([]);
808+
809+
const wrapper = mount({
810+
setup() {
811+
return () => (
812+
<LayTable
813+
columns={columns}
814+
dataSource={dataSource.value}
815+
></LayTable>
816+
);
817+
},
818+
});
819+
820+
await nextTick()
821+
822+
const checkboxComponent = wrapper.findComponent(".layui-table-header .layui-table-header-wrapper tr th .layui-checkbox");
823+
824+
expect((checkboxComponent as any).vm.modelValue).toBeFalsy();
825+
});
801826
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy