1import useImpliedTicket from './useImpliedTicket';
3describe('#useImpliedTicket', () => {
4 const { location } = window;
7 delete window.location;
11 window.location = location;
14 describe('when hash is not present in URL', () => {
15 it('returns null', () => {
17 window.location = { hash: input };
23 } = useImpliedTicket();
24 expect(impliedAzimuthPoint).toEqual(null);
25 expect(impliedPatp).toEqual(null);
26 expect(impliedTicket).toEqual(null);
30 describe('when hash is just a ticket', () => {
31 it('parses the ticket, returns null point', () => {
32 const input = '#widweb-tipfep-sabnux-nispec';
33 window.location = { hash: input };
39 } = useImpliedTicket();
40 expect(impliedAzimuthPoint).toEqual(null);
41 expect(impliedPatp).toEqual(null);
42 expect(impliedTicket).toEqual('~widweb-tipfep-sabnux-nispec');
46 describe('when hash has both ticket and star point', () => {
47 it('parses the ticket, returns null point', () => {
48 const input = '#widweb-tipfep-sabnux-nispec-sampel';
49 window.location = { hash: input };
55 } = useImpliedTicket();
56 expect(impliedAzimuthPoint).toEqual(1135);
57 expect(impliedPatp).toBe('~sampel');
58 expect(impliedTicket).toEqual('~widweb-tipfep-sabnux-nispec');
62 describe('when hash has both ticket and planet point', () => {
63 it('parses both ticket and point', () => {
64 const input = '#widweb-tipfep-sabnux-nispec-sampel-palnet';
65 window.location = { hash: input };
71 } = useImpliedTicket();
72 expect(impliedAzimuthPoint).toEqual(1624961343);
73 expect(impliedPatp).toBe('~sampel-palnet');
74 expect(impliedTicket).toEqual('~widweb-tipfep-sabnux-nispec');
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list