Skip to content

Commit

Permalink
Add additional test for app chrome hidden versus chrome visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperelman committed Nov 5, 2019
1 parent fea12a3 commit b9a7f95
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/core/public/chrome/chrome_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ describe('start', () => {
]
`);
});

it('changing visibility has no effect on chrome-hiding application', async () => {
const startDeps = defaultStartDeps([new FakeApp('alpha', true)]);
const { currentAppId$ } = startDeps.application;
const { chrome, service } = await start({ startDeps });
const promise = chrome
.getIsVisible$()
.pipe(toArray())
.toPromise();

currentAppId$.next('alpha');
chrome.setIsVisible(true);
service.stop();

await expect(promise).resolves.toMatchInlineSnapshot(`
Array [
true,
false,
false,
]
`);
});
});

describe('is collapsed', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class ChromeService {
}: StartDeps): Promise<InternalChromeStart> {
/**
* These observables allow consumers to toggle the chrome visibility via either:
* 1. Using setIsVisible() to trigger the next hide$
* 1. Using setIsVisible() to trigger the next chromeHidden$
* 2. Setting `chromeHidden` when registering an application, which will
* reset the visibility whenever the next application is mounted
* 3. Having embed=true in the query string
Expand Down

0 comments on commit b9a7f95

Please sign in to comment.