Skip to content

Commit 64ea91c

Browse files
committed
Failing test for #1622
1 parent 8086319 commit 64ea91c

7 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎test/dart_only/views/packages_view.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,21 @@ describe("packages tree", () => {
2727
const file = ensurePackageTreeNode(myPackageLibContents, PackageDepFile, "my_thing.dart");
2828
assert.equal(fsPath(file.resourceUri), fsPath(myPackageThingFile));
2929
});
30+
31+
it("sorts the same way as VS Code explorer", () => {
32+
const topLevel = extApi.packagesTreeProvider.getChildren(undefined);
33+
const myPackage = ensurePackageTreeNode(topLevel, PackageDepPackage, "my_package");
34+
const myPackageLibContents = extApi.packagesTreeProvider.getChildren(myPackage);
35+
36+
const names = myPackageLibContents.map((f) => f.label);
37+
const expectedNamesInOrder = ["z_folder",
38+
"MY_FILE_2.txt",
39+
"my_file.txt",
40+
"ZZZ_2.txt",
41+
"zzz.txt",
42+
];
43+
const actualNames = names.filter((n) => expectedNamesInOrder.indexOf(n) !== -1);
44+
45+
assert.equal(actualNames, expectedNamesInOrder);
46+
});
3047
});

‎test/test_projects/my_package/lib/MY_FILE_2.txt‎

Whitespace-only changes.

‎test/test_projects/my_package/lib/ZZZ_2.txt‎

Whitespace-only changes.

‎test/test_projects/my_package/lib/my_file.txt‎

Whitespace-only changes.
File renamed without changes.

‎test/test_projects/my_package/lib/z_folder/empty.txt‎

Whitespace-only changes.

‎test/test_projects/my_package/lib/zzz.txt‎

Whitespace-only changes.

0 commit comments

Comments
 (0)