feat: Implement auth serializer
This commit is contained in:
17
packages/backend/src/serializers/auth.test.js
Normal file
17
packages/backend/src/serializers/auth.test.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import App from '../models/app';
|
||||
import authSerializer from './auth';
|
||||
|
||||
describe('authSerializer', () => {
|
||||
it('should return auth data', async () => {
|
||||
const auth = await App.findAuthByKey('deepl');
|
||||
|
||||
const expectedPayload = {
|
||||
fields: auth.fields,
|
||||
authenticationSteps: auth.authenticationSteps,
|
||||
reconnectionSteps: auth.reconnectionSteps,
|
||||
};
|
||||
|
||||
expect(authSerializer(auth)).toEqual(expectedPayload);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user