@vertesia/tools-sdk 1.6.0-dev.20260923.085325Z → 1.6.0-dev.20261008.064737Z

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.
@@ -1,45 +0,0 @@
1
- import type { InCodeViewDefinition } from '@vertesia/common';
2
- import { describe, expect, it } from 'vitest';
3
- import { createToolServer } from '../server.js';
4
-
5
- const view: InCodeViewDefinition = {
6
- id: 'document-library',
7
- name: 'document-library',
8
- title: 'Document Library',
9
- tags: ['content'],
10
- definition: {
11
- name: 'Document Library',
12
- layout: { mode: 'browse' },
13
- results: {
14
- default_display: 'list',
15
- displays: [
16
- {
17
- id: 'list',
18
- label: 'List',
19
- type: 'list',
20
- title: { field: 'name' },
21
- },
22
- ],
23
- },
24
- },
25
- };
26
-
27
- describe('in-code View app package', () => {
28
- it('exposes Views through the package scope and direct resource route', async () => {
29
- const app = createToolServer({ views: [view], disableHtml: true });
30
- const packageResponse = await app.request('/api/package?scope=views');
31
- const directResponse = await app.request('/api/views/document-library');
32
-
33
- expect(packageResponse.status).toBe(200);
34
- expect(await packageResponse.json()).toEqual({ views: [view] });
35
- expect(directResponse.status).toBe(200);
36
- expect(await directResponse.json()).toEqual(view);
37
- });
38
-
39
- it('returns 404 for an unknown View', async () => {
40
- const app = createToolServer({ views: [view], disableHtml: true });
41
- const response = await app.request('/api/views/missing');
42
-
43
- expect(response.status).toBe(404);
44
- });
45
- });