Skip to content

Commit

Permalink
[ACS-8634] Use latest ADF, fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKinas committed Oct 28, 2024
1 parent 09af0ad commit 2eec0cf
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 117 deletions.
164 changes: 67 additions & 97 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
},
"private": true,
"dependencies": {
"@alfresco/adf-content-services": "7.0.0-alpha.4",
"@alfresco/adf-core": "7.0.0-alpha.4",
"@alfresco/adf-extensions": "7.0.0-alpha.4",
"@alfresco/eslint-plugin-eslint-angular": "7.0.0-alpha.4",
"@alfresco/js-api": "8.0.0-alpha.4",
"@alfresco/adf-content-services": "7.0.0-alpha.5-11519897356",
"@alfresco/adf-core": "7.0.0-alpha.5-11519897356",
"@alfresco/adf-extensions": "7.0.0-alpha.5-11519897356",
"@alfresco/eslint-plugin-eslint-angular": "7.0.0-alpha.5-11519897356",
"@alfresco/js-api": ">=8.0.0-alpha.4-11519897356",
"@angular/animations": "16.2.9",
"@angular/cdk": "16.2.9",
"@angular/common": "16.2.9",
Expand Down Expand Up @@ -62,8 +62,8 @@
"zone.js": "0.13.3"
},
"devDependencies": {
"@alfresco/adf-cli": "7.0.0-alpha.4",
"@angular-devkit/build-angular": "16.2.16",
"@alfresco/adf-cli": "7.0.0-alpha.5-11519897356",
"@angular-devkit/build-angular": "16.2.9",
"@angular-devkit/core": "16.2.9",
"@angular-devkit/schematics": "16.2.9",
"@angular-eslint/builder": "17.0.0",
Expand Down
8 changes: 4 additions & 4 deletions projects/aca-content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"peerDependencies": {
"@angular/common": ">=15.2",
"@angular/core": ">=15.2",
"@alfresco/adf-core": ">=7.0.0-alpha.4",
"@alfresco/adf-content-services": ">=7.0.0-alpha.4",
"@alfresco/adf-extensions": ">=7.0.0-alpha.4",
"@alfresco/js-api": ">=8.0.0-alpha.4",
"@alfresco/adf-core": ">=7.0.0-alpha.5-0",
"@alfresco/adf-content-services": ">=7.0.0-alpha.5-0",
"@alfresco/adf-extensions": ">=7.0.0-alpha.5-0",
"@alfresco/js-api": ">=8.0.0-alpha.5-0",
"@angular/animations": ">=15.2",
"@angular/cdk": ">=15.2",
"@angular/forms": ">=15.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ describe('SaveSearchDialogComponent', () => {
it('should disable submit button if form is invalid', () => {
spyOn(savedSearchesService, 'saveSearch').and.callThrough();
submitButton.click();
fixture.detectChanges();
expect(component.form.valid).toBeFalse();
expect(submitButton.disabled).toBeTrue();
expect(savedSearchesService.saveSearch).not.toHaveBeenCalled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CORE_PIPES, CoreTestingModule } from '@alfresco/adf-core';
import { BehaviorSubject, ReplaySubject, Subject } from 'rxjs';
import { By } from '@angular/platform-browser';
import { SavedSearchesService } from '@alfresco/adf-content-services';
import { SavedSearchesService, SavedSearch } from '@alfresco/adf-content-services';
import { SavedSearchesSmartListComponent } from './saved-searches-smart-list.component';
import { SavedSearch } from '@alfresco/adf-content-services/lib/common/interfaces/saved-search.interface';
import { AppService, DocumentBasePageService, DocumentBasePageServiceMock } from '@alfresco/aca-shared';
import { AppState } from '@alfresco/aca-shared/store';
import { provideMockStore } from '@ngrx/store/testing';

const appServiceMock = {
Expand All @@ -41,13 +41,26 @@ const appServiceMock = {
describe('SavedSearchesSmartListComponent', () => {
let fixture: ComponentFixture<SavedSearchesSmartListComponent>;
let fakeSavedSearches$: ReplaySubject<SavedSearch[]>;
let appState: Partial<AppState> = {};

beforeEach(() => {
fakeSavedSearches$ = new ReplaySubject<SavedSearch[]>(1);
appState = {
selection: {
count: 0,
isEmpty: false,
libraries: [],
nodes: []
},
navigation: {},
infoDrawerOpened: false
};
TestBed.configureTestingModule({
imports: [CoreTestingModule, SavedSearchesSmartListComponent],
providers: [
provideMockStore(),
provideMockStore({
initialState: { app: appState }
}),
...CORE_PIPES,
{ provide: DocumentBasePageService, useClass: DocumentBasePageServiceMock },
{ provide: SavedSearchesService, useValue: { savedSearches$: fakeSavedSearches$ } },
Expand Down
Loading

0 comments on commit 2eec0cf

Please sign in to comment.