-
Notifications
You must be signed in to change notification settings - Fork 31
[AXON-109] Expose toggle switch to push branch to remote (Start work) #137
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
Merged
marcomura
merged 8 commits into
main
from
AXON-109-allow-for-start-work-to-be-configured-to-push
Feb 21, 2025
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
11b2a80
Added branch name validation for space characters
marcomura 9b93482
Expose toggle switch to push branch to origin (Start work)
marcomura 2cc0178
Refer to 'remote' not 'origin'
marcomura d2469fa
change switch default to true, and add switch status to telemetry
marcomura f51751d
fix copy/paste bug
marcomura 78fdba9
small fix and unit tests
marcomura 01d48f6
Updated CHANGELOG
marcomura e9438d4
small improvements
marcomura File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { viewScreenEvent } from './analytics'; | ||
|
||
interface MockedData { | ||
getFirstAAID_value?: boolean; | ||
} | ||
|
||
const mockedData: MockedData = {}; | ||
|
||
jest.mock('./container', () => ({ | ||
Container: { siteManager: { getFirstAAID: () => mockedData.getFirstAAID_value } }, | ||
})); | ||
|
||
function setProcessPlatform(platform: NodeJS.Platform) { | ||
Object.defineProperty(process, 'platform', { | ||
value: platform, | ||
writable: false, | ||
}); | ||
} | ||
|
||
describe('viewScreenEvent', () => { | ||
const originalPlatform = process.platform; | ||
|
||
beforeAll(() => { | ||
setProcessPlatform('win32'); | ||
}); | ||
|
||
beforeEach(() => { | ||
mockedData.getFirstAAID_value = true; | ||
}); | ||
|
||
afterAll(() => { | ||
setProcessPlatform(originalPlatform); | ||
}); | ||
|
||
it('should create a screen event with the correct screen name', async () => { | ||
const screenName = 'testScreen'; | ||
const event = await viewScreenEvent(screenName); | ||
expect(event.name).toEqual(screenName); | ||
expect(event.screenEvent.attributes).toBeUndefined(); | ||
}); | ||
|
||
it('should exclude from activity if screen name is atlascodeWelcomeScreen', async () => { | ||
const screenName = 'atlascodeWelcomeScreen'; | ||
const event = await viewScreenEvent(screenName); | ||
expect(event.screenEvent.attributes.excludeFromActivity).toBeTruthy(); | ||
}); | ||
|
||
it('should include site information if provided (cloud)', async () => { | ||
const screenName = 'testScreen'; | ||
const site: any = { | ||
id: 'siteId', | ||
product: { name: 'Jira', key: 'jira' }, | ||
isCloud: true, | ||
}; | ||
const event = await viewScreenEvent(screenName, site); | ||
expect(event.screenEvent.attributes.instanceType).toEqual('cloud'); | ||
expect(event.screenEvent.attributes.hostProduct).toEqual('Jira'); | ||
}); | ||
|
||
it('should include site information if provided (server)', async () => { | ||
const screenName = 'testScreen'; | ||
const site: any = { | ||
id: 'siteId', | ||
product: { name: 'Jira', key: 'jira' }, | ||
isCloud: false, | ||
}; | ||
const event = await viewScreenEvent(screenName, site); | ||
expect(event.screenEvent.attributes.instanceType).toEqual('server'); | ||
expect(event.screenEvent.attributes.hostProduct).toEqual('Jira'); | ||
}); | ||
|
||
it('should include product information if provided', async () => { | ||
const screenName = 'testScreen'; | ||
const product = { name: 'Bitbucket', key: 'bitbucket' }; | ||
const event = await viewScreenEvent(screenName, undefined, product); | ||
expect(event.screenEvent.attributes.hostProduct).toEqual('Bitbucket'); | ||
}); | ||
|
||
it('should set platform based on process.platform (win32)', async () => { | ||
setProcessPlatform('win32'); | ||
const screenName = 'testScreen'; | ||
const event = await viewScreenEvent(screenName); | ||
expect(event.screenEvent.platform).toEqual('windows'); | ||
}); | ||
|
||
it('should set platform based on process.platform (darwin)', async () => { | ||
setProcessPlatform('darwin'); | ||
const screenName = 'testScreen'; | ||
const event = await viewScreenEvent(screenName); | ||
expect(event.screenEvent.platform).toEqual('mac'); | ||
}); | ||
|
||
it('should set platform based on process.platform (linux)', async () => { | ||
setProcessPlatform('linux'); | ||
const screenName = 'testScreen'; | ||
const event = await viewScreenEvent(screenName); | ||
expect(event.screenEvent.platform).toEqual('linux'); | ||
}); | ||
|
||
it('should set platform based on process.platform (aix)', async () => { | ||
setProcessPlatform('aix'); | ||
const screenName = 'testScreen'; | ||
const event = await viewScreenEvent(screenName); | ||
expect(event.screenEvent.platform).toEqual('desktop'); | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.