@object-ui/plugin-view 3.1.1 → 3.1.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.
@@ -661,5 +661,45 @@ describe('ObjectView', () => {
661
661
  expect(callSchema?.showFilters).toBe(false);
662
662
  expect(callSchema?.showSort).toBe(false);
663
663
  });
664
+
665
+ it('should propagate userFilters from activeView in renderListView', async () => {
666
+ const schema: ObjectViewSchema = {
667
+ type: 'object-view',
668
+ objectName: 'contacts',
669
+ };
670
+
671
+ const renderListViewSpy = vi.fn(({ schema: listSchema }: any) => (
672
+ <div data-testid="custom-list">Custom ListView</div>
673
+ ));
674
+
675
+ const views = [
676
+ {
677
+ id: 'v1',
678
+ label: 'View 1',
679
+ type: 'grid' as const,
680
+ userFilters: {
681
+ element: 'dropdown' as const,
682
+ fields: [{ field: 'status' }],
683
+ },
684
+ },
685
+ ];
686
+
687
+ render(
688
+ <ObjectView
689
+ schema={schema}
690
+ dataSource={mockDataSource}
691
+ views={views}
692
+ activeViewId="v1"
693
+ renderListView={renderListViewSpy}
694
+ />,
695
+ );
696
+
697
+ expect(renderListViewSpy).toHaveBeenCalled();
698
+ const callSchema = renderListViewSpy.mock.calls[0]?.[0]?.schema;
699
+ expect(callSchema?.userFilters).toEqual({
700
+ element: 'dropdown',
701
+ fields: [{ field: 'status' }],
702
+ });
703
+ });
664
704
  });
665
705
  });
@@ -1,32 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
-
9
- import { describe, it, expect } from 'vitest';
10
- import { ObjectView, ViewSwitcher, FilterUI, SortUI } from '../index';
11
-
12
- describe('Plugin View Registration', () => {
13
- it('exports ObjectView component', () => {
14
- expect(ObjectView).toBeDefined();
15
- expect(typeof ObjectView).toBe('function');
16
- });
17
-
18
- it('exports ViewSwitcher component', () => {
19
- expect(ViewSwitcher).toBeDefined();
20
- expect(typeof ViewSwitcher).toBe('function');
21
- });
22
-
23
- it('exports FilterUI component', () => {
24
- expect(FilterUI).toBeDefined();
25
- expect(typeof FilterUI).toBe('function');
26
- });
27
-
28
- it('exports SortUI component', () => {
29
- expect(SortUI).toBeDefined();
30
- expect(typeof SortUI).toBe('function');
31
- });
32
- });