1 |
|
2 | import { parse } from './symbol-parse';
|
3 |
|
4 | it('should parse symbol strings for base', () => {
|
5 | expect(parse('𝠀')).toEqual({
|
6 | 'base': '𝠀'
|
7 | });
|
8 | })
|
9 |
|
10 |
|
11 | it('should parse symbol strings', () => {
|
12 | expect(parse('𝠀𝪛')).toEqual({'base': '𝠀','fill': '𝪛'});
|
13 | })
|
14 |
|
15 | it('should parse symbol strings', () => {
|
16 | expect(parse('𝠀𝪡')).toEqual({'base': '𝠀','rotation':'𝪡'});
|
17 | })
|
18 |
|
19 | it('should parse symbol strings for base with fill and rotation', () => {
|
20 | expect(parse('𝠀𝪛𝪡')).toEqual({'base': '𝠀','fill': '𝪛','rotation':'𝪡'});
|
21 | })
|
22 |
|
23 |
|
24 |
|
25 | it('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 | })
|