Skip to content

Commit 47b7f8b

Browse files
committed
Use jest's expect in UTs
1 parent 1eb76a1 commit 47b7f8b

File tree

4 files changed

+7
-110
lines changed

4 files changed

+7
-110
lines changed

e2e/tests/auth.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expect } from 'chai';
21
import { before, after, EditorView, Workbench, By, ActivityBar, SideBarView } from 'vscode-extension-tester';
32

43
describe('Auth User', async () => {
@@ -27,11 +26,11 @@ describe('Auth User', async () => {
2726

2827
it('in SideBarView should see Create issue... button', async () => {
2928
const atlasDrawer = sideBarView.findElement(By.id('workbench.view.extension.atlascode-drawer'));
30-
expect(atlasDrawer).to.not.be.undefined;
29+
expect(atlasDrawer).toBeDefined();
3130

3231
const createIssueButton = atlasDrawer.findElement(By.css('[aria-label="Create issue..."]'));
33-
expect(createIssueButton).to.not.be.undefined;
34-
expect(await createIssueButton.getText()).to.equal('Create issue...');
32+
expect(createIssueButton).toBeDefined();
33+
expect(await createIssueButton.getText()).toEqual('Create issue...');
3534
});
3635

3736
it('in SideBarView should see a assigned JIRA issues', async () => {});

e2e/tests/no-auth.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expect } from 'chai';
21
import { before, ActivityBar, after, SideBarView, By, EditorView, Workbench } from 'vscode-extension-tester';
32

43
describe('Atlassian Extension Activity Bar', async () => {
@@ -15,7 +14,7 @@ describe('Atlassian Extension Activity Bar', async () => {
1514
// Get title from every control
1615
const titles = await Promise.all(controls.map(async (control) => control.getTitle()));
1716

18-
expect('Atlassian').to.be.oneOf(titles);
17+
expect(titles).toContain('Atlassian');
1918
});
2019
});
2120

@@ -41,12 +40,12 @@ describe('Atlassian Extension SideBar', async () => {
4140

4241
it('should have a login action suggestion', async () => {
4342
const atlasDrawer = sideBarView.findElement(By.id('workbench.view.extension.atlascode-drawer'));
44-
expect(atlasDrawer).to.not.be.undefined;
43+
expect(atlasDrawer).toBeDefined();
4544

4645
// find element by aria-label: "Please login to Jira"
4746
const loginButton = atlasDrawer.findElement(By.css('[aria-label="Please login to Jira"]'));
48-
expect(loginButton).to.not.be.undefined;
49-
expect(await loginButton.getText()).to.equal('Please login to Jira');
47+
expect(loginButton).toBeDefined();
48+
expect(await loginButton.getText()).toEqual('Please login to Jira');
5049
});
5150
});
5251

package-lock.json

Lines changed: 0 additions & 100 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,6 @@
15301530
"ajv-formats": "^3.0.1",
15311531
"autoprefixer": "^10.4.20",
15321532
"babel-loader": "^9.2.1",
1533-
"chai": "^4",
15341533
"concurrently": "^9.1.2",
15351534
"cross-env": "^7.0.2",
15361535
"css-loader": "^7.1.2",

0 commit comments

Comments
 (0)