refactor: Use matchsnapshot for datastore tests

This commit is contained in:
Faruk AYDIN
2024-09-30 16:43:06 +03:00
parent 9006a0c25f
commit 7abe44da19
2 changed files with 37 additions and 3 deletions

View File

@@ -0,0 +1,36 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`Datastore model > jsonSchema should have correct validations 1`] = `
{
"properties": {
"id": {
"format": "uuid",
"type": "string",
},
"key": {
"minLength": 1,
"type": "string",
},
"scope": {
"default": "flow",
"enum": [
"flow",
],
"type": "string",
},
"scopeId": {
"format": "uuid",
"type": "string",
},
"value": {
"type": "string",
},
},
"required": [
"key",
"value",
"scopeId",
],
"type": "object",
}
`;

View File

@@ -7,8 +7,6 @@ describe('Datastore model', () => {
});
it('jsonSchema should have correct validations', () => {
expect(Datastore).toRequireProperty('key');
expect(Datastore).toRequireProperty('value');
expect(Datastore).toRequireProperty('scopeId');
expect(Datastore.jsonSchema).toMatchSnapshot();
});
});