1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const chai_1 = require("chai");
|
19 | const label_provider_1 = require("./label-provider");
|
20 | const uri_1 = require("../common/uri");
|
21 | const os_1 = require("../common/os");
|
22 | describe('DefaultUriLabelProviderContribution', function () {
|
23 | it('should return a short name', function () {
|
24 | const prov = new label_provider_1.DefaultUriLabelProviderContribution();
|
25 | const shortName = prov.getName(new uri_1.default('file:///tmp/hello/you.txt'));
|
26 | (0, chai_1.expect)(shortName).eq('you.txt');
|
27 | });
|
28 | it('should return a long name', function () {
|
29 | const prov = new label_provider_1.DefaultUriLabelProviderContribution();
|
30 | const longName = prov.getLongName(new uri_1.default('file:///tmp/hello/you.txt'));
|
31 | if (os_1.OS.backend.isWindows) {
|
32 | (0, chai_1.expect)(longName).eq('\\tmp\\hello\\you.txt');
|
33 | }
|
34 | else {
|
35 | (0, chai_1.expect)(longName).eq('/tmp/hello/you.txt');
|
36 | }
|
37 | });
|
38 | it('should return icon class for something that seems to be a file', function () {
|
39 | const prov = new label_provider_1.DefaultUriLabelProviderContribution();
|
40 | const icon = prov.getIcon(new uri_1.default('file:///tmp/hello/you.txt'));
|
41 | (0, chai_1.expect)(icon).eq('text-icon medium-blue theia-file-icons-js');
|
42 | });
|
43 | it('should return file icon class for something that seems to be a directory', function () {
|
44 | const prov = new label_provider_1.DefaultUriLabelProviderContribution();
|
45 | const icon = prov.getIcon(new uri_1.default('file:///tmp/hello'));
|
46 | (0, chai_1.expect)(icon).eq(prov.defaultFileIcon);
|
47 | });
|
48 | it('should return folder icon class for something that is a directory', function () {
|
49 | const prov = new label_provider_1.DefaultUriLabelProviderContribution();
|
50 | const icon = prov.getIcon(label_provider_1.URIIconReference.create('folder', new uri_1.default('file:///tmp/hello')));
|
51 | (0, chai_1.expect)(icon).eq(prov.defaultFolderIcon);
|
52 | });
|
53 | });
|
54 |
|
\ | No newline at end of file |