describe('<SidePanelButton />', () => {
describe('isProjectTrashed', () => {
+ it('should return false if project is undefined', () => {
+ // given
+ const proj = undefined;
+ const resources = {};
+
+ // when
+ const result = isProjectTrashed(proj, resources);
+
+ // then
+ expect(result).toBeFalsy();
+ });
+
it('should return false if parent project is undefined', () => {
// given
const proj = {};
expect(result).toBeTruthy();
});
- it.only('should return false for undefined parent projects', () => {
+ it('should return false for undefined parent projects', () => {
// given
const proj = {
ownerUuid: 'ce8i5-j7d0g-000000000000000',
horizontal: 0
};
-export const isProjectTrashed = (proj: GroupResource, resources: ResourcesState): boolean => {
+export const isProjectTrashed = (proj: GroupResource | undefined, resources: ResourcesState): boolean => {
if (proj === undefined) { return false; }
if (proj.isTrashed) { return true; }
if (extractUuidKind(proj.ownerUuid) === ResourceKind.USER) { return false; }
const parentProj = getResource<GroupResource>(proj.ownerUuid)(resources);
- console.log(1);
- return isProjectTrashed(parentProj!, resources);
+ return isProjectTrashed(parentProj, resources);
};
export const SidePanelButton = withStyles(styles)(