Skip to content

Commit

Permalink
added some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Cross committed Jan 12, 2025
1 parent 4c43ab0 commit ece756d
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions app/components/Approvals/Snaps/helpers/constants/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { DelineatorType, getDelineatorTitle } from './index';

describe('Delineator Constants', () => {
describe('DelineatorType enum', () => {
it('should have the correct values', () => {
expect(DelineatorType.Content).toBe('content');
expect(DelineatorType.Error).toBe('error');
expect(DelineatorType.Insights).toBe('insights');
expect(DelineatorType.Description).toBe('description');
expect(DelineatorType.Warning).toBe('warning');
});
});

describe('getDelineatorTitle', () => {
it('should return correct title for Error type', () => {
expect(getDelineatorTitle(DelineatorType.Error)).toBe('errorWithSnap');
});

it('should return correct title for Insights type', () => {
expect(getDelineatorTitle(DelineatorType.Insights)).toBe(
'insightsFromSnap',
);
});

it('should return correct title for Description type', () => {
expect(getDelineatorTitle(DelineatorType.Description)).toBe(
'descriptionFromSnap',
);
});

it('should return correct title for Warning type', () => {
expect(getDelineatorTitle(DelineatorType.Warning)).toBe(
'warningFromSnap',
);
});

it('should return default title for Content type', () => {
expect(getDelineatorTitle(DelineatorType.Content)).toBe(
'contentFromSnap',
);
});

it('should return default title for unknown type', () => {
expect(getDelineatorTitle('unknown' as DelineatorType)).toBe(
'contentFromSnap',
);
});
});
});

0 comments on commit ece756d

Please sign in to comment.