UNPKG

882 BJavaScriptView Raw
1
2import { parse } from './symbol-parse';
3
4it('should parse symbol strings for base', () => {
5 expect(parse('𝠀')).toEqual({
6 'base': '𝠀'
7 });
8})
9
10
11it('should parse symbol strings', () => {
12 expect(parse('𝠀𝪛')).toEqual({'base': '𝠀','fill': '𝪛'});
13})
14
15it('should parse symbol strings', () => {
16 expect(parse('𝠀𝪡')).toEqual({'base': '𝠀','rotation':'𝪡'});
17})
18
19it('should parse symbol strings for base with fill and rotation', () => {
20 expect(parse('𝠀𝪛𝪡')).toEqual({'base': '𝠀','fill': '𝪛','rotation':'𝪡'});
21})
22
23
24
25it('should parse without breaking on bad data', () => {
26 expect(parse()).toEqual({
27 });
28 expect(parse(undefined)).toEqual({
29 });
30 expect(parse("S10000500x500-CZ5")).toEqual({
31 });
32 expect(parse(['-Zx'])).toEqual({
33 });
34 expect(parse({ "this": "that" })).toEqual({
35 });
36})