mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(cloudcmd) add ability to use not only alphabet and number symbols (#167)
This commit is contained in:
parent
48c36eb5d3
commit
5479dce7da
8 changed files with 199 additions and 117 deletions
32
test/common/btoa.js
Normal file
32
test/common/btoa.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
'use strict';
|
||||
|
||||
const test = require('tape');
|
||||
const diff = require('sinon-called-with-diff');
|
||||
const sinon = diff(require('sinon'));
|
||||
|
||||
const btoa = require('../../common/btoa');
|
||||
|
||||
test('btoa: browser', (t) => {
|
||||
const btoaOriginal = global.btoa;
|
||||
const str = 'hello';
|
||||
|
||||
global.btoa = sinon.stub();
|
||||
|
||||
btoa(str);
|
||||
|
||||
t.ok(global.btoa.calledWith(str), 'should call global.btoa');
|
||||
t.end();
|
||||
|
||||
global.btoa = btoaOriginal;
|
||||
});
|
||||
|
||||
test('btoa: node', (t) => {
|
||||
const str = 'hello';
|
||||
const expected = 'aGVsbG8=';
|
||||
|
||||
const result = btoa(str);
|
||||
|
||||
t.equal(result, expected, 'should encode base64');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
@ -12,14 +12,14 @@
|
|||
<span data-name="js-date" class="date reduce-text">--.--.----</span>
|
||||
<span data-name="js-owner" class="owner reduce-text">.</span>
|
||||
<span data-name="js-mode" class="mode reduce-text">--- --- ---</span>
|
||||
</li><li draggable="true" data-name="js-file-applnk" class="">
|
||||
</li><li draggable="true" data-name="js-file-YXBwbG5r" class="">
|
||||
<span data-name="js-type" class="mini-icon directory"></span>
|
||||
<span data-name="js-name" class="name reduce-text"><a href="/fs/etc/X11/applnk" title="applnk" draggable="true">applnk</a></span>
|
||||
<span data-name="js-size" class="size reduce-text"><dir></span>
|
||||
<span data-name="js-date" class="date reduce-text">21.02.2016</span>
|
||||
<span data-name="js-owner" class="owner reduce-text">root</span>
|
||||
<span data-name="js-mode" class="mode reduce-text">rwx r-x r-x</span>
|
||||
</li><li draggable="true" data-name="js-file-prefdm" class="">
|
||||
</li><li draggable="true" data-name="js-file-cHJlZmRt" class="">
|
||||
<span data-name="js-type" class="mini-icon text-file"></span>
|
||||
<span data-name="js-name" class="name reduce-text"><a href="/fs/etc/X11/prefdm" title="prefdm" target="_blank" draggable="true">prefdm</a></span>
|
||||
<span data-name="js-size" class="size reduce-text">1.30kb</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue