vuetable-next 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuetable-next",
3
3
  "description": "Simple table for displaying data.",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "author": "Artem Alesenko",
6
6
  "type": "module",
7
7
  "private": false,
@@ -330,7 +330,7 @@ const instanceFetch = ref<Promise<AxiosResponse>>();
330
330
 
331
331
  const $_css = reactive({ ...CssSemanticUI.table, ...css });
332
332
 
333
- const dataIsAvailable = computed(() => tableData.value?.length! > 0 ?? false);
333
+ const dataIsAvailable = computed(() => !tableData.value?.length ? false : tableData.value?.length > 0);
334
334
  const useDetailRow = computed(() => dataIsAvailable.value && detailRowComponent !== "");
335
335
  const hasRowIdentifier = computed(() => tableData.value && typeof tableData.value[0][trackBy] !== "undefined");
336
336
  const countVisibleFields = computed(() => tableFields.value.filter(field => field.visible).length);
@@ -0,0 +1,27 @@
1
+ import { mount } from "@vue/test-utils";
2
+ import VuetableFieldCheckbox from "../src/components/VuetableFieldCheckbox.vue";
3
+ import Vuetable from "../src/components/Vuetable.vue";
4
+
5
+ describe("Vuetable - Components", () => {
6
+ it("render VuetableFieldCheckbox", () => {
7
+ const root = mount(Vuetable, {
8
+ propsData: {
9
+ apiMode: false,
10
+ fields: [
11
+ { name: "code", titleClass: "foo-bar" }
12
+ ]
13
+ }
14
+ });
15
+ const wrapper = mount(VuetableFieldCheckbox, {
16
+ propsData: {
17
+ rowData: ["code"]
18
+ },
19
+ global: {
20
+ provide: {
21
+ vuetable: root.vm
22
+ }
23
+ }
24
+ });
25
+ expect(wrapper.element).toMatchSnapshot();
26
+ });
27
+ });
@@ -0,0 +1,11 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Vuetable - Components > render VuetableFieldCheckbox 1`] = `
4
+ <td
5
+ class="vuetable-td-component-checkbox"
6
+ >
7
+ <input
8
+ type="checkbox"
9
+ />
10
+ </td>
11
+ `;