Skip to content

Commit

Permalink
test: add string with escaped braces
Browse files Browse the repository at this point in the history
  • Loading branch information
keindev committed Feb 17, 2022
1 parent 00985d8 commit d2c4062
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/__tests__/Theme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import stripAnsi from 'strip-ansi';
import { IndicationBadge, IndicationType, Theme } from '../Theme';

describe('Theme', (): void => {
const text = 'text';
const text = { input: '\\{\\{\\{t\\}e\\}x{red t}\\}', output: '{{{t}e}xt}' };

it('Default', (): void => {
const theme = new Theme();

expect(stripAnsi(theme.paint(text, IndicationType.Default))).toBe(text);
expect(stripAnsi(theme.paint(text, IndicationType.Success))).toBe(text);
expect(stripAnsi(theme.paint(text, IndicationType.Skip))).toBe(text);
expect(stripAnsi(theme.paint(text, IndicationType.Error))).toBe(text);
expect(stripAnsi(theme.paint(text.input, IndicationType.Default))).toBe(text.output);
expect(stripAnsi(theme.paint(text.input, IndicationType.Success))).toBe(text.output);
expect(stripAnsi(theme.paint(text.input, IndicationType.Skip))).toBe(text.output);
expect(stripAnsi(theme.paint(text.input, IndicationType.Error))).toBe(text.output);

expect(stripAnsi(theme.symbol(IndicationType.Default))).toBe(stripAnsi(figures.pointerSmall));
expect(stripAnsi(theme.symbol(IndicationType.Success))).toBe(stripAnsi(figures.tick));
Expand All @@ -34,10 +34,10 @@ describe('Theme', (): void => {
error: { symbol, badge },
});

expect(stripAnsi(theme.paint(text, IndicationType.Default))).toBe(text);
expect(stripAnsi(theme.paint(text, IndicationType.Success))).toBe(text);
expect(stripAnsi(theme.paint(text, IndicationType.Skip))).toBe(text);
expect(stripAnsi(theme.paint(text, IndicationType.Error))).toBe(text);
expect(stripAnsi(theme.paint(text.input, IndicationType.Default))).toBe(text.output);
expect(stripAnsi(theme.paint(text.input, IndicationType.Success))).toBe(text.output);
expect(stripAnsi(theme.paint(text.input, IndicationType.Skip))).toBe(text.output);
expect(stripAnsi(theme.paint(text.input, IndicationType.Error))).toBe(text.output);

expect(stripAnsi(theme.symbol(IndicationType.Default))).toBe(symbol);
expect(stripAnsi(theme.symbol(IndicationType.Success))).toBe(symbol);
Expand Down

0 comments on commit d2c4062

Please sign in to comment.