-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/devel' into CB-4257-ability-to-a…
…ssume-aws-session-using-any-open-id-provider
- Loading branch information
Showing
17 changed files
with
120 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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
1 change: 1 addition & 0 deletions
1
webapp/packages/core-blocks/src/Tree/TreeNode/TreeNodeIcon.m.css
This file contains 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 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 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 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
1 change: 1 addition & 0 deletions
1
webapp/packages/core-sdk/src/queries/fragments/AuthProviderConfigurationInfo.gql
This file contains 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 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 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 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,47 @@ | ||
import { cacheValue } from './cacheValue'; | ||
|
||
describe('cacheValue', () => { | ||
it('should return cached value', () => { | ||
const cache = cacheValue(); | ||
const value = cache.value(() => 1); | ||
expect(value).toBe(1); | ||
expect(cache.invalid).toBe(false); | ||
}); | ||
|
||
it('should invalidate cache', () => { | ||
const cache = cacheValue(); | ||
cache.value(() => 1); | ||
cache.invalidate(); | ||
expect(cache.invalid).toBe(true); | ||
}); | ||
|
||
it('should calculate new value if invalidated', () => { | ||
const fn = jest.fn(() => 1); | ||
const cache = cacheValue(); | ||
cache.value(fn); | ||
cache.invalidate(); | ||
expect(cache.invalid).toBe(true); | ||
const value = cache.value(fn); | ||
expect(value).toBe(1); | ||
expect(cache.invalid).toBe(false); | ||
expect(fn).toHaveBeenCalledTimes(2); | ||
}); | ||
|
||
it('should not calculate new value if not invalidated', () => { | ||
const fn = jest.fn(() => 1); | ||
const cache = cacheValue(); | ||
cache.value(fn); | ||
const value = cache.value(fn); | ||
expect(value).toBe(1); | ||
expect(cache.invalid).toBe(false); | ||
expect(fn).toHaveBeenCalledTimes(1); | ||
}); | ||
|
||
it('should cache value until it is invalidated', () => { | ||
const cache = cacheValue(); | ||
expect(cache.value(() => 1)).toBe(1); | ||
expect(cache.value(() => 2)).toBe(1); | ||
cache.invalidate(); | ||
expect(cache.value(() => 3)).toBe(3); | ||
}); | ||
}); |
This file contains 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,18 @@ | ||
import { timestampToDate } from './timestampToDate'; | ||
|
||
describe('timestampToDate', () => { | ||
it('should convert timestamp to date', () => { | ||
const date = timestampToDate(1591862400000); | ||
expect(date).toBe('6/11/2020, 8:00:00 AM'); | ||
}); | ||
|
||
it('should convert negative timestamp to date', () => { | ||
const date = timestampToDate(-1591862400000); | ||
expect(date).toBe('7/23/1919, 4:00:00 PM'); | ||
}); | ||
|
||
it('should convert zero timestamp to date', () => { | ||
const date = timestampToDate(0); | ||
expect(date).toBe('1/1/1970, 12:00:00 AM'); | ||
}); | ||
}); |
This file contains 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