File size: 610 Bytes
3206347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { describe, it, expect } from 'vitest';
import App from '../models/app';
import actionSerializer from './action';

describe('actionSerializer', () => {
  it('should return the action data', async () => {
    const actions = await App.findActionsByKey('github');
    const action = actions[0];

    const expectedPayload = {
      description: action.description,
      key: action.key,
      name: action.name,
      pollInterval: action.pollInterval,
      showWebhookUrl: action.showWebhookUrl,
      type: action.type,
    };

    expect(actionSerializer(action)).toEqual(expectedPayload);
  });
});