fix: error return while editor loading (#369)

This commit is contained in:
Kristin Aoki
2023-08-08 12:41:15 -04:00
committed by GitHub
parent d25ae09273
commit 918370f743
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ export const returnUrl = ({ studioEndpointUrl, unitUrl, learningContextId }) =>
if (unitUrl) {
return unit({ studioEndpointUrl, unitUrl });
}
throw new Error('No unit url for return url');
return '';
};
export const block = ({ studioEndpointUrl, blockId }) => (

View File

@@ -55,8 +55,8 @@ describe('cms url methods', () => {
.toEqual(`${studioEndpointUrl}/container/${unitUrl.data.ancestors[0].id}`);
});
it('throws error if no unit url', () => {
expect(() => { returnUrl({ studioEndpointUrl, unitUrl: null, learningContextId: courseId }); })
.toThrow('No unit url for return url');
expect(returnUrl({ studioEndpointUrl, unitUrl: null, learningContextId: courseId }))
.toEqual('');
});
it('returns the library page when given the library', () => {
expect(libraryV1({ studioEndpointUrl, learningContextId: libraryV1Id }))