Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use jest's 'expect' in UTs #141

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions e2e/tests/auth.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from 'chai';
import { before, after, EditorView, Workbench, By, ActivityBar, SideBarView } from 'vscode-extension-tester';

describe('Auth User', async () => {
Expand Down Expand Up @@ -27,11 +26,11 @@ describe('Auth User', async () => {

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

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

it('in SideBarView should see a assigned JIRA issues', async () => {});
Expand Down
9 changes: 4 additions & 5 deletions e2e/tests/no-auth.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from 'chai';
import { before, ActivityBar, after, SideBarView, By, EditorView, Workbench } from 'vscode-extension-tester';

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

expect('Atlassian').to.be.oneOf(titles);
expect(titles).toContain('Atlassian');
});
});

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

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

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

Expand Down
1 change: 0 additions & 1 deletion e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"strictNullChecks": true,
"ignoreDeprecations": "5.0",
"noUnusedLocals": true,
"typeRoots": ["node_modules/@types", "src/typings/"]
},
"include": ["tests/**/*"]
}
95 changes: 0 additions & 95 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,6 @@
"ajv-formats": "^3.0.1",
"autoprefixer": "^10.4.20",
"babel-loader": "^9.2.1",
"chai": "^4",
"concurrently": "^9.1.2",
"cross-env": "^7.0.2",
"css-loader": "^7.1.2",
Expand Down
Loading