Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit cf62cef

Browse files
committed
Add a status bar present directory test.
1 parent aefaf0c commit cf62cef

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/views/StatusBarComponent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const VcsDataComponent = ({data}: { data: VcsData }) => {
3636
};
3737

3838
export const StatusBarComponent = ({presentWorkingDirectory}: { presentWorkingDirectory: string }) =>
39-
<div style={css.statusBar.itself}>
39+
<div className="status-bar" style={css.statusBar.itself}>
4040
<span style={css.statusBar.icon}>{fontAwesome.folderOpen}</span>
41-
<span style={css.statusBar.presentDirectory}>{presentWorkingDirectory}</span>
41+
<span className="present-directory" style={css.statusBar.presentDirectory}>{presentWorkingDirectory}</span>
4242
<VcsDataComponent data={watchManager.vcsDataFor(presentWorkingDirectory)}/>
4343
</div>;

test/e2e.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class Page {
2424
get job() {
2525
return new Job(this.client, this.client.element(".job"));
2626
}
27+
28+
get statusBar() {
29+
return new StatusBar(this.client, this.client.element(".status-bar"));
30+
}
2731
}
2832

2933
abstract class Block {
@@ -57,6 +61,12 @@ class JobMenu extends Block {
5761
}
5862
}
5963

64+
class StatusBar extends Block {
65+
get presentDirectory() {
66+
return this.selector.element(".present-directory");
67+
}
68+
}
69+
6070
describe("application launch", function () {
6171
this.timeout(timeout);
6272

@@ -104,4 +114,17 @@ describe("application launch", function () {
104114
const output = await page.job.output.getText();
105115
expect(output).to.eql("Received SIGTERM");
106116
});
117+
118+
describe("status bar", () => {
119+
it("changes working directory on cd", async () => {
120+
const oldDirectory = __dirname + "/";
121+
const newDirectory = join(oldDirectory, "utils") + "/";
122+
123+
await page.executeCommand(`cd ${oldDirectory}`);
124+
expect(await page.statusBar.presentDirectory.getText()).to.eql(oldDirectory);
125+
126+
await page.executeCommand(`cd ${newDirectory}`);
127+
expect(await page.statusBar.presentDirectory.getText()).to.eql(newDirectory);
128+
});
129+
});
107130
});

0 commit comments

Comments
 (0)