diff --git a/projects/netgrif-components-core/src/lib/navigation/service/uri.service.spec.ts b/projects/netgrif-components-core/src/lib/navigation/service/uri.service.spec.ts index 72ff8495d..46067a03c 100644 --- a/projects/netgrif-components-core/src/lib/navigation/service/uri.service.spec.ts +++ b/projects/netgrif-components-core/src/lib/navigation/service/uri.service.spec.ts @@ -42,7 +42,7 @@ describe('UriService', () => { it('should get root node', () => { const root = service.root; - expect(root.id).toEqual('root'); + expect(root.path).toEqual('root'); expect(service.isRoot(root)).toBeTruthy(); expect(service.activeNode).toEqual(root); }); @@ -59,8 +59,7 @@ describe('UriService', () => { it('should get node by path', done => { service.getNodeByPath(MockUriResourceService.TEST1_PATH).subscribe(res => { - expect(res.uriPath).toEqual(MockUriResourceService.TEST1_PATH); - expect(res.id).toEqual(MockUriResourceService.TEST1_ID); + expect(res.path).toEqual(MockUriResourceService.TEST1_PATH); done(); }); }); @@ -69,7 +68,7 @@ describe('UriService', () => { service.getChildNodes(service.root).subscribe(res => { expect(res.length).toEqual(2); res.forEach(r => { - expect(r.id).toContain('test'); + expect(r.path).toContain('test'); expect(r.parentId).toEqual('root'); }); done(); @@ -85,9 +84,9 @@ describe('UriService', () => { it('should get siblings of a node', done => { service.getNodeByPath(MockUriResourceService.TEST1_PATH).subscribe(node => { - expect(node.id).toEqual(MockUriResourceService.TEST1_ID); + expect(node.path).toEqual(MockUriResourceService.TEST1_PATH); service.getSiblingsOfNode(node).subscribe(siblings => { - expect(siblings.find(n => n.id === MockUriResourceService.TEST2_ID)).not.toBeUndefined(); + expect(siblings.find(n => n.path === MockUriResourceService.TEST2_PATH)).not.toBeUndefined(); done(); }); }); @@ -110,9 +109,7 @@ describe('UriService', () => { it('should get parts of path', done => { service.getNodeByPath(MockUriResourceService.TEST1_PATH).subscribe(node => { - const path = service.splitNodePath(node); - expect(path.length).toEqual(1); - expect(path[0]).toEqual(MockUriResourceService.TEST1_ID); + expect(node.path).toEqual(MockUriResourceService.TEST1_PATH); done(); }); }); diff --git a/projects/netgrif-components-core/src/lib/utility/tests/mocks/mock-uri-resource.service.ts b/projects/netgrif-components-core/src/lib/utility/tests/mocks/mock-uri-resource.service.ts index da55d714e..68ffed360 100644 --- a/projects/netgrif-components-core/src/lib/utility/tests/mocks/mock-uri-resource.service.ts +++ b/projects/netgrif-components-core/src/lib/utility/tests/mocks/mock-uri-resource.service.ts @@ -8,26 +8,22 @@ import {ResourceProvider} from '../../../resources/resource-provider.service'; @Injectable() export class MockUriResourceService extends UriResourceService { - static TEST1_ID = 'test1'; static TEST1_PATH = 'root/test1'; - static TEST2_ID = 'test2'; static TEST2_PATH = 'root/test2'; private _root: UriNodeResource = { - id: 'root', - uriPath: 'root', + path: 'root', name: 'root', parentId: null, parent: undefined, - childrenId: new Set([MockUriResourceService.TEST1_ID, MockUriResourceService.TEST2_ID]), + childrenId: new Set([MockUriResourceService.TEST1_PATH, MockUriResourceService.TEST2_PATH]), children: undefined, level: 0, contentTypes: undefined, } as UriNodeResource; private _test1Node: UriNodeResource = { - id: MockUriResourceService.TEST1_ID, - uriPath: MockUriResourceService.TEST1_PATH, - name: MockUriResourceService.TEST1_ID, + path: MockUriResourceService.TEST1_PATH, + name: MockUriResourceService.TEST1_PATH, parentId: 'root', parent: this._root, childrenId: undefined, @@ -36,9 +32,8 @@ export class MockUriResourceService extends UriResourceService { contentTypes: new Set([UriContentType.PROCESS]), } as UriNodeResource; private _test2Node: UriNodeResource = { - id: MockUriResourceService.TEST2_ID, - uriPath: MockUriResourceService.TEST2_PATH, - name: MockUriResourceService.TEST2_ID, + path: MockUriResourceService.TEST2_PATH, + name: MockUriResourceService.TEST2_PATH, parentId: 'root', parent: this._root, childrenId: undefined,