Skip to content

Commit

Permalink
Fix environment icon for dark mode (#1097)
Browse files Browse the repository at this point in the history
* Fix environment icon for dark mode

* Refactor

* Fix test
  • Loading branch information
priyanshu92 authored Jan 24, 2025
1 parent 41a1bd8 commit 47ae571
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/client/assets/environment-icon/dark/environment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/client/assets/environment-icon/light/environment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export class EnvironmentGroupTreeItem extends ActionsHubTreeItem {
super(
environmentInfo.currentEnvironmentName,
vscode.TreeItemCollapsibleState.Collapsed,
vscode.Uri.joinPath(context.extensionUri, 'src', 'client', 'assets', 'environment.svg'),
{
light: vscode.Uri.joinPath(context.extensionUri, 'src', 'client', 'assets', 'environment-icon', 'light', 'environment.svg'),
dark: vscode.Uri.joinPath(context.extensionUri, 'src', 'client', 'assets', 'environment-icon', 'dark', 'environment.svg')
},
Constants.ContextValues.ENVIRONMENT_GROUP);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ describe('EnvironmentGroupTreeItem', () => {
it('should have the expected icon', () => {
const treeItem = new EnvironmentGroupTreeItem({ currentEnvironmentName: "Test Environment" }, { extensionUri: vscode.Uri.parse("http://localhost") } as vscode.ExtensionContext);

expect((treeItem.iconPath as vscode.Uri).path).to.be.equal('/src/client/assets/environment.svg');
expect((treeItem.iconPath as { light: vscode.Uri, dark: vscode.Uri }).light.path).to.be.equal('/src/client/assets/environment-icon/light/environment.svg');
expect((treeItem.iconPath as { light: vscode.Uri, dark: vscode.Uri }).dark.path).to.be.equal('/src/client/assets/environment-icon/dark/environment.svg');
});

it('should have the expected contextValue', () => {
Expand Down

0 comments on commit 47ae571

Please sign in to comment.