forked from onecx/onecx-portal-ui-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extraction of harnesses to separate lib
- Loading branch information
Showing
67 changed files
with
332 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
libs/angular-accelerator/testing/column-group-selection.harness.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
libs/angular-accelerator/testing/custom-group-column-selector.harness.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
libs/angular-accelerator/testing/data-layout-selection.harness.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
libs/angular-accelerator/testing/interactive-data-view.harness.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
libs/angular-accelerator/testing/more-actions-menu-button.harness.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import { ComponentHarness } from "@angular/cdk/testing"; | ||
import { PMenuHarness } from "./primeng/p-menu.harness"; | ||
import { ComponentHarness } from '@angular/cdk/testing' | ||
import { PMenuHarness } from '@onecx/angular-testing' | ||
|
||
export class PageHeaderHarness extends ComponentHarness { | ||
static hostSelector = 'ocx-page-header' | ||
static hostSelector = 'ocx-page-header' | ||
|
||
getPageHeaderWrapperHarness = this.locatorForAll('[name="ocx-page-header-wrapper"]') | ||
getPageHeaderWrapperHarness = this.locatorForAll('[name="ocx-page-header-wrapper"]') | ||
|
||
async getInlineActionButtons() { | ||
return await this.locatorForAll('[name="ocx-page-header-inline-action-button"]')() | ||
} | ||
async getInlineActionButtons() { | ||
return await this.locatorForAll('[name="ocx-page-header-inline-action-button"]')() | ||
} | ||
|
||
async getOverflowActionButtons() { | ||
return await this.locatorForAll('[name="ocx-page-header-overflow-action-button"]')() | ||
} | ||
async getOverflowActionButtons() { | ||
return await this.locatorForAll('[name="ocx-page-header-overflow-action-button"]')() | ||
} | ||
|
||
async getElementByTitle(title: string) { | ||
return await this.locatorForOptional(`[title="${title}"]`)() | ||
} | ||
async getElementByTitle(title: string) { | ||
return await this.locatorForOptional(`[title="${title}"]`)() | ||
} | ||
|
||
async getObjectInfos() { | ||
return await this.locatorForAll('.object-info')() | ||
} | ||
async getObjectInfos() { | ||
return await this.locatorForAll('.object-info')() | ||
} | ||
|
||
async getObjectDetailLabels() { | ||
return await this.locatorForAll('[name="object-detail-label"]')() | ||
} | ||
async getObjectDetailLabels() { | ||
return await this.locatorForAll('[name="object-detail-label"]')() | ||
} | ||
|
||
async getObjectDetailValues() { | ||
return await this.locatorForAll('[name="object-detail-value"]')() | ||
} | ||
async getObjectDetailValues() { | ||
return await this.locatorForAll('[name="object-detail-value"]')() | ||
} | ||
|
||
async getObjectDetailIcons() { | ||
return await this.locatorForAll('[name="object-detail-icon"]')() | ||
} | ||
async getObjectDetailIcons() { | ||
return await this.locatorForAll('[name="object-detail-icon"]')() | ||
} | ||
|
||
async getOverFlowMenuItems() { | ||
const menu = await this.locatorFor(PMenuHarness)() | ||
const menuItems = await menu.getAllMenuItems() | ||
return menuItems ?? [] | ||
} | ||
} | ||
async getOverFlowMenuItems() { | ||
const menu = await this.locatorFor(PMenuHarness)() | ||
const menuItems = await menu.getAllMenuItems() | ||
return menuItems ?? [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"extends": ["../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts"], | ||
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"], | ||
"rules": { | ||
"@angular-eslint/directive-selector": [ | ||
"error", | ||
{ | ||
"type": "attribute", | ||
"prefix": "ocx", | ||
"style": "camelCase" | ||
} | ||
], | ||
"@angular-eslint/component-selector": [ | ||
"error", | ||
{ | ||
"type": "element", | ||
"prefix": "ocx", | ||
"style": "kebab-case" | ||
} | ||
], | ||
"no-restricted-syntax": [ | ||
"off", | ||
{ | ||
"selector": "CallExpression[callee.object.name=\"console\"][callee.property.name=/^(debug|info|time|timeEnd|trace)$/]" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.html"], | ||
"extends": ["plugin:@nx/angular-template"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.json"], | ||
"parser": "jsonc-eslint-parser", | ||
"rules": { | ||
"@nx/dependency-checks": "error" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# angular-testing | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Running unit tests | ||
|
||
Run `nx test angular-testing` to execute the unit tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'angular-testing', | ||
preset: '../../jest.preset.js', | ||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], | ||
coverageDirectory: '../../coverage/libs/angular-testing', | ||
transform: { | ||
'^.+\\.(ts|mjs|js|html)$': [ | ||
'jest-preset-angular', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
}, | ||
], | ||
}, | ||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], | ||
snapshotSerializers: [ | ||
'jest-preset-angular/build/serializers/no-ng-attributes', | ||
'jest-preset-angular/build/serializers/ng-snapshot', | ||
'jest-preset-angular/build/serializers/html-comment', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/libs/angular-testing", | ||
"lib": { | ||
"entryFile": "src/index.ts" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "@onecx/angular-testing", | ||
"version": "4.9.0", | ||
"peerDependencies": { | ||
"@angular/cdk": "^15.2.7", | ||
"primeng": "^15.2.1" | ||
}, | ||
"dependencies": {}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
Oops, something went wrong.