Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / cds-ui / designer-client / src / app / modules / feature-modules / packages / packages.store.spec.ts
1 import { TestBed } from '@angular/core/testing';
2 import { PackagesStore } from './packages.store';
3 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
4 import { PackagesApiService } from './packages-api.service';
5 import { of } from 'rxjs';
6 import { BluePrintPage } from './model/BluePrint.model';
7 import { getBluePrintPageMock } from './blueprint.page.mock';
8 import { PackagesDashboardState } from './model/packages-dashboard.state';
9
10 describe('PackagesStore', () => {
11     //    store: PackagesStore;
12
13     const MOCK_BLUEPRINTS_PAGE: BluePrintPage = getBluePrintPageMock();
14
15
16     let httpMock: HttpTestingController;
17
18     beforeEach(() => {
19         TestBed.configureTestingModule({
20             imports: [
21                 HttpClientTestingModule
22             ],
23             providers: [
24                 PackagesStore,
25                 PackagesApiService
26             ]
27         });
28         httpMock = TestBed.get(HttpTestingController);
29
30     });
31
32     it('should correctly get page of packages', () => {
33         const packagesServiceSpy = jasmine.createSpyObj('PackagesListService', ['getPagedPackages']);
34
35         // set the value to return when the ` getPagedPackages` spy is called.
36         packagesServiceSpy.getPagedPackages.and.returnValue(of([MOCK_BLUEPRINTS_PAGE]));
37         // store = new PackagesStore(packagesServiceSpy);
38
39         // Todo check the Abbas's code
40         /*store.getPagedPackages(0, 2);
41         store.state$.subscribe(page => {
42             expect(store.state).toEqual(MOCK_BLUEPRINTS_PAGE);
43         });*/
44
45     });
46
47     it('should correctly get all packages', () => {
48         const packagesServiceSpy = jasmine.createSpyObj('PackagesListService', ['getPagedPackages']);
49
50         // set the value to return when the `getPagedPackages` spy is called.
51         packagesServiceSpy.getPagedPackages.and.returnValue(of([MOCK_BLUEPRINTS_PAGE]));
52         // store = new PackagesStore(packagesServiceSpy);
53         // store.getAll();
54         // store.state$.subscribe(page => {
55         //     expect(store.state.page).toEqual(MOCK_BLUEPRINTS_PAGE);
56         // });
57
58     });
59 });
60