Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bwieger-atlassian-com committed Dec 19, 2024
1 parent 3a8581e commit e5a7295
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
38 changes: 16 additions & 22 deletions e2e/tests/no-auth.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect } from 'chai';
import { before, ActivityBar, after, SideBarView, By, WebView, EditorView, Workbench} from 'vscode-extension-tester';

import { before, ActivityBar, after, SideBarView, By, WebView, EditorView, Workbench } from 'vscode-extension-tester';

describe('Atlassian Extension Activity Bar', async () => {
let activityBar: ActivityBar;
Expand All @@ -23,7 +22,7 @@ describe('Atlassian Extension Activity Bar', async () => {
describe('Atlassian Extension SideBar', async () => {
let activityBar: ActivityBar;
let sideBarView: SideBarView;

before(async () => {
activityBar = new ActivityBar();
(await activityBar.getViewControl('Atlassian'))?.openView();
Expand All @@ -39,15 +38,13 @@ describe('Atlassian Extension SideBar', async () => {
after(async () => {});

it('should have a login action suggestion', async () => {


let atlasDrawer = sideBarView.findElement(By.id('workbench.view.extension.atlascode-drawer'));
expect(atlasDrawer).to.not.be.undefined;

// 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(await loginButton.getText()).to.equal('Please login to Jira');
});
});

Expand All @@ -57,17 +54,17 @@ describe('Atlassian Extension Settings Page', async () => {
before(async () => {
await new EditorView().closeAllEditors();
await new Workbench().executeCommand('Atlassian: Open Settings');
await new Promise((res) => {
setTimeout(res, 6000);
});
// init the WebView page object
view = new WebView();
await new Promise((res) => {
setTimeout(res, 6000);
});
// init the WebView page object
view = new WebView();
});

after(async () => {
// after we are done with the webview, switch webdriver back to the vscode window
await view.switchBack();
await new EditorView().closeAllEditors();
await view.switchBack();
await new EditorView().closeAllEditors();
});

it('should have a title', async () => {
Expand All @@ -76,17 +73,14 @@ describe('Atlassian Extension Settings Page', async () => {
});

it('should have an Authentication Section', async () => {
// can't write this test because selectors on webViews is broken
// /~https://github.com/redhat-developer/vscode-extension-tester/issues/1492
// can't write this test because selectors on webViews is broken
// /~https://github.com/redhat-developer/vscode-extension-tester/issues/1492
// Going to add our repro steps to the issue in hopes that this gets fixed

// alternative: we could downgrade the version that we test.
// No. because we should be testing on the latest version of VSCode
// No. because we should be testing on the latest version of VSCode
// alternative: we could speed up the bug fix by contributing to the project
// Perhaps, but we have other priorities first. Eg: testing the authenticated flows
// alternative: we could do some kind of screenshot computer vision test
// Maybe, but seems overkill for something that looks like its going to be fixed soon

// Perhaps, but we have other priorities first. Eg: testing the authenticated flows
// alternative: we could do some kind of screenshot computer vision test
// Maybe, but seems overkill for something that looks like its going to be fixed soon
});

});
8 changes: 7 additions & 1 deletion src/react/atlascode/config/auth/CloudAuthButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export const CloudAuthButton: React.FunctionComponent<CloudAuthButtonProps> = ({
};

return (
<Button id="settings.login.cloud.button" variant="contained" color="primary" startIcon={<CloudIcon />} onClick={() => handleCloudProd()}>
<Button
id="settings.login.cloud.button"
variant="contained"
color="primary"
startIcon={<CloudIcon />}
onClick={() => handleCloudProd()}
>
{loginText}
</Button>
);
Expand Down
8 changes: 7 additions & 1 deletion src/react/atlascode/onboarding/AltCloudAuthButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ export const AltCloudAuthButton: React.FunctionComponent<AltCloudAuthButtonProps

return (
<Tooltip title={'Opens a browser window to log in via OAuth'}>
<Button id="onboarding.cloud.button" variant="contained" color="primary" className={classes.button} onClick={handleCloudProd}>
<Button
id="onboarding.cloud.button"
variant="contained"
color="primary"
className={classes.button}
onClick={handleCloudProd}
>
<Grid container direction="column">
<Grid container direction="row" alignItems="center" justify="center" spacing={3}>
<Grid item>
Expand Down

0 comments on commit e5a7295

Please sign in to comment.