mirror of
https://github.com/directus/directus.git
synced 2026-02-17 14:21:27 -05:00
24 lines
472 B
TypeScript
24 lines
472 B
TypeScript
/**
|
|
* @jest-environment node
|
|
*/
|
|
|
|
import { Directus } from '../../src';
|
|
import { test } from '../utils';
|
|
|
|
describe('fields', function () {
|
|
test(`update one`, async (url, nock) => {
|
|
const scope = nock()
|
|
.patch('/fields/posts/title', { meta: { required: true } })
|
|
.reply(200, {});
|
|
|
|
const sdk = new Directus(url);
|
|
await sdk.fields.updateOne('posts', 'title', {
|
|
meta: {
|
|
required: true,
|
|
},
|
|
});
|
|
|
|
expect(scope.pendingMocks().length).toBe(0);
|
|
});
|
|
});
|