mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-09-15 12:45:13 +00:00
20862be7d0
- slim/slim: ^3.1 - symfony/expression-language: ^3.4 - fxp/composer-asset-plugin: ~1.3 - bower-asset/vue: ^2.5 - bower-asset/vue-resource: ^1.5
33 lines
758 B
JavaScript
33 lines
758 B
JavaScript
import Vue from 'vue';
|
|
|
|
describe('Vue.url', function () {
|
|
|
|
it('data{/id}', function () {
|
|
|
|
expect(Vue.url('data{/id}')).toBe('data');
|
|
expect(Vue.url('data{/id}', {id: 1})).toBe('data/1');
|
|
|
|
});
|
|
|
|
it('data{/array}', function () {
|
|
|
|
expect(Vue.url('data{?array}')).toBe('data');
|
|
expect(Vue.url('data{?array}', {array: [1,2,3]})).toBe('data?array=1,2,3');
|
|
|
|
});
|
|
|
|
it('{+path}data', function () {
|
|
|
|
expect(Vue.url('{+path}data')).toBe('data');
|
|
expect(Vue.url('{+path}data', {path: 'path1/path2/'})).toBe('path1/path2/data');
|
|
|
|
});
|
|
|
|
it('{+base}data', function () {
|
|
|
|
Vue.url.options.params.base = 'base/path/';
|
|
expect(Vue.url('{+base}data')).toBe('base/path/data');
|
|
|
|
});
|
|
|
|
});
|