Summary: _typescript_ Reviewed By: passy Differential Revision: D16762117 fbshipit-source-id: b6ee32e0bb3fc686fc69cfccab703e2ef4989571
32 lines
951 B
JavaScript
32 lines
951 B
JavaScript
/**
|
|
* Copyright 2018-present Facebook.
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
* @format
|
|
*/
|
|
|
|
import {uriComponents} from '../application.tsx';
|
|
|
|
test('test parsing of deeplink URL', () => {
|
|
const url = 'flipper://app/plugin/meta/data';
|
|
const components = uriComponents(url);
|
|
expect(components).toEqual(['app', 'plugin', 'meta/data']);
|
|
});
|
|
|
|
test('test parsing of deeplink URL when arguments are less', () => {
|
|
const url = 'flipper://app/';
|
|
const components = uriComponents(url);
|
|
expect(components).toEqual(['app']);
|
|
});
|
|
|
|
test('test parsing of deeplink URL when url is null', () => {
|
|
const components = uriComponents(null);
|
|
expect(components).toEqual([]);
|
|
});
|
|
|
|
test('test parsing of deeplink URL when pattern does not match', () => {
|
|
const url = 'Some random string';
|
|
const components = uriComponents(url);
|
|
expect(components).toEqual([]);
|
|
});
|