mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[AAE-30877] - Here we go
This commit is contained in:
parent
d7a9b01328
commit
6d330f91e5
21
.github/workflows/pull-request.yml
vendored
21
.github/workflows/pull-request.yml
vendored
@ -64,7 +64,7 @@ jobs:
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Ensure SHA pinned actions
|
||||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@25ed13d0628a1601b4b44048e63cc4328ed03633 # v3.0.22
|
||||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@4830be28ce81da52ec70d65c552a7403821d98d4 # v3.0.23
|
||||
|
||||
- name: Check package-lock.json version
|
||||
run: |
|
||||
@ -84,10 +84,10 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get branch name
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@c1236aee36bb9b35c5972819fcf8a4d07572e6cd # v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@45bb8b664779b691f8a21d9fd49e360916726c11 # v8.18.1
|
||||
|
||||
- name: Save commit message
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/get-commit-message@c1236aee36bb9b35c5972819fcf8a4d07572e6cd # v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/get-commit-message@45bb8b664779b691f8a21d9fd49e360916726c11 # v8.18.1
|
||||
|
||||
- name: ci:force flag parser
|
||||
shell: bash
|
||||
@ -173,7 +173,7 @@ jobs:
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
unit-tests:
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 30
|
||||
name: "Unit tests: ${{ matrix.unit-tests.name }}"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup]
|
||||
@ -182,7 +182,18 @@ jobs:
|
||||
# max-parallel: 4
|
||||
matrix:
|
||||
unit-tests:
|
||||
- name: js-api
|
||||
exclude: "core,insights,content-services,process-services,process-services-cloud,eslint-plugin-eslint-angular"
|
||||
- name: content-services
|
||||
exclude: "insights,core,extensions,process-services,process-services-cloud,eslint-plugin-eslint-angular,js-api"
|
||||
- name: core
|
||||
exclude: "insights,content-services,process-services,process-services-cloud,eslint-plugin-eslint-angular,js-api"
|
||||
- name: insights
|
||||
exclude: "core,extensions,content-services,process-services-cloud,process-services,eslint-plugin-eslint-angular,js-api"
|
||||
- name: process-services
|
||||
exclude: "core,extensions,content-services,process-services-cloud,insights,eslint-plugin-eslint-angular,js-api"
|
||||
- name: process-services-cloud
|
||||
exclude: "insights,core,extensions,content-services,process-services$,eslint-plugin-eslint-angular,js-api"
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@ -192,7 +203,7 @@ jobs:
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
xvfb-run --auto-servernum npx nx run ${{ matrix.unit-tests.name}}:test --verbose
|
||||
/usr/bin/xvfb-run --auto-servernum npx nx affected:test $NX_CALCULATION_FLAGS --exclude=${{ matrix.unit-tests.exclude }}
|
||||
|
||||
lint:
|
||||
# long timeout required when cache has to be recreated
|
||||
|
@ -100,7 +100,7 @@ class BlobTestComponent {
|
||||
}
|
||||
}
|
||||
//eslint-disable-next-line
|
||||
xdescribe('Test PdfViewer component', () => {
|
||||
fdescribe('Test PdfViewer component', () => {
|
||||
let component: PdfViewerComponent;
|
||||
let fixture: ComponentFixture<PdfViewerComponent>;
|
||||
let change: any;
|
||||
@ -353,7 +353,7 @@ xdescribe('Test PdfViewer component', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// eslint-disable-next-line
|
||||
fdescribe('Test PdfViewer - Zoom customization', () => {
|
||||
let fixtureUrlTestComponent: ComponentFixture<UrlTestComponent>;
|
||||
let componentUrlTestComponent: UrlTestComponent;
|
||||
@ -381,35 +381,33 @@ fdescribe('Test PdfViewer - Zoom customization', () => {
|
||||
});
|
||||
|
||||
describe('custom value', () => {
|
||||
beforeEach((done) => {
|
||||
beforeEach(async () => {
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config['adf-viewer.pdf-viewer-scaling'] = 80;
|
||||
|
||||
fixtureUrlTestComponent.detectChanges();
|
||||
|
||||
firstValueFrom(componentUrlTestComponent.pdfViewerComponent.rendered).then(() => {
|
||||
done();
|
||||
});
|
||||
}, 55000);
|
||||
await fixtureUrlTestComponent.whenStable();
|
||||
await firstValueFrom(componentUrlTestComponent.pdfViewerComponent.rendered);
|
||||
});
|
||||
|
||||
it('should use the custom zoom if it is present in the app.config', fakeAsync(() => {
|
||||
spyOn(componentUrlTestComponent.pdfViewerComponent.pdfViewer, 'forceRendering').and.callFake(() => {});
|
||||
|
||||
fixtureUrlTestComponent.detectChanges();
|
||||
tick(2000);
|
||||
tick();
|
||||
|
||||
expect(componentUrlTestComponent.pdfViewerComponent.pdfViewer.currentScale).toBe(0.8);
|
||||
}));
|
||||
});
|
||||
|
||||
xdescribe('less than the minimum allowed value', () => {
|
||||
describe('less than the minimum allowed value', () => {
|
||||
beforeEach(async () => {
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config['adf-viewer.pdf-viewer-scaling'] = 10;
|
||||
|
||||
fixtureUrlTestComponent.detectChanges();
|
||||
await fixtureUrlTestComponent.whenStable();
|
||||
|
||||
await firstValueFrom(componentUrlTestComponent.pdfViewerComponent.rendered);
|
||||
});
|
||||
|
||||
it('should use the minimum scale zoom if the value given in app.config is less than the minimum allowed scale', async () => {
|
||||
@ -422,18 +420,18 @@ fdescribe('Test PdfViewer - Zoom customization', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xdescribe('greater than the maximum allowed value', () => {
|
||||
describe('greater than the maximum allowed value', () => {
|
||||
beforeEach(async () => {
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config['adf-viewer.pdf-viewer-scaling'] = 5555;
|
||||
|
||||
fixtureUrlTestComponent.detectChanges();
|
||||
await fixtureUrlTestComponent.whenStable();
|
||||
|
||||
await firstValueFrom(componentUrlTestComponent.pdfViewerComponent.rendered);
|
||||
});
|
||||
|
||||
it('should use the maximum scale zoom if the value given in app.config is greater than the maximum allowed scale', async () => {
|
||||
|
||||
await firstValueFrom(componentUrlTestComponent.pdfViewerComponent.rendered);
|
||||
spyOn(componentUrlTestComponent.pdfViewerComponent.pdfViewer, 'forceRendering').and.callFake(() => {});
|
||||
|
||||
fixtureUrlTestComponent.detectChanges();
|
||||
@ -442,8 +440,8 @@ fdescribe('Test PdfViewer - Zoom customization', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
xdescribe('Test PdfViewer - User interaction', () => {
|
||||
// eslint-disable-next-line
|
||||
fdescribe('Test PdfViewer - User interaction', () => {
|
||||
let fixtureUrlTestComponent: ComponentFixture<UrlTestComponent>;
|
||||
let componentUrlTestComponent: UrlTestComponent;
|
||||
let testingUtils: UnitTestingUtils;
|
||||
@ -471,7 +469,7 @@ xdescribe('Test PdfViewer - User interaction', () => {
|
||||
|
||||
fixtureUrlTestComponent.detectChanges();
|
||||
await fixtureUrlTestComponent.whenStable();
|
||||
|
||||
await firstValueFrom(componentUrlTestComponent.pdfViewerComponent.rendered);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
10
package-lock.json
generated
10
package-lock.json
generated
@ -38,7 +38,7 @@
|
||||
"material-icons": "^1.13.12",
|
||||
"minimatch": "^10.0.1",
|
||||
"ng2-charts": "^4.1.1",
|
||||
"pdfjs-dist": "4.10.38",
|
||||
"pdfjs-dist": "5.1.91",
|
||||
"raphael": "2.3.0",
|
||||
"rxjs": "7.8.1",
|
||||
"superagent": "^9.0.1",
|
||||
@ -33837,15 +33837,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/pdfjs-dist": {
|
||||
"version": "4.10.38",
|
||||
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz",
|
||||
"integrity": "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ==",
|
||||
"version": "5.1.91",
|
||||
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-5.1.91.tgz",
|
||||
"integrity": "sha512-qSIADdagooJB4wWCBnrBJjRvASevmxL0BwafvOuKJG5uTQdYoFBrhrRYnucKNiSc9qS6JIk0hC5y1yktFljXkA==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@napi-rs/canvas": "^0.1.65"
|
||||
"@napi-rs/canvas": "^0.1.67"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
|
@ -58,7 +58,7 @@
|
||||
"material-icons": "^1.13.12",
|
||||
"minimatch": "^10.0.1",
|
||||
"ng2-charts": "^4.1.1",
|
||||
"pdfjs-dist": "4.10.38",
|
||||
"pdfjs-dist": "5.1.91",
|
||||
"raphael": "2.3.0",
|
||||
"rxjs": "7.8.1",
|
||||
"superagent": "^9.0.1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user