Skip to content

Commit

Permalink
279-subscription-general: Remove obsolete getColor function
Browse files Browse the repository at this point in the history
  • Loading branch information
DutchBen authored and Ruben van Leeuwen committed Oct 9, 2023
1 parent 6e73a22 commit 49a66ac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
import { FieldValue } from '../../../types';
import {
getColor,
getFieldFromProductBlockInstanceValues,
getProductBlockTitle,
} from './utils';

describe('getColor()', () => {
it('returns "error" when color is 0', () => {
const result = getColor(0);
expect(result).toEqual('danger');
});
it('returns "warning" when color is 1', () => {
const result = getColor(1);
expect(result).toEqual('warning');
});
it('returns "primary" when color is 2', () => {
const result = getColor(2);
expect(result).toEqual('primary');
});
});

describe('getFieldFromProductBlockInstanceValues()', () => {
const instanceValues: FieldValue[] = [
{ field: 'field1', value: 'value1' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ export const tabs = [
},
];

export function getColor(num: number) {
if (num === 1) return 'warning';
if (num === 2) return 'primary';
return 'danger';
}

export const getFieldFromProductBlockInstanceValues = (
instanceValues: FieldValue[],
field: string,
Expand Down

0 comments on commit 49a66ac

Please sign in to comment.