Skip to content

Commit

Permalink
fix: 🐛 mock selection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mdasberg committed Jan 15, 2023
1 parent 9e57572 commit 53f3f4e
Show file tree
Hide file tree
Showing 8 changed files with 1,779 additions and 1,526 deletions.
70 changes: 35 additions & 35 deletions package.json
Expand Up @@ -51,63 +51,63 @@
"recording"
],
"devDependencies": {
"@angular/animations": "15.0.3",
"@angular/cdk": "15.0.2",
"@angular/common": "15.0.3",
"@angular/compiler": "15.0.3",
"@angular/core": "15.0.3",
"@angular/forms": "15.0.3",
"@angular/material": "15.0.2",
"@angular/platform-browser": "15.0.3",
"@angular/platform-browser-dynamic": "15.0.3",
"@angular/router": "15.0.3",
"@angular-devkit/build-angular": "15.0.3",
"@angular-eslint/builder": "15.1.0",
"@angular-eslint/eslint-plugin": "15.1.0",
"@angular-eslint/eslint-plugin-template": "15.1.0",
"@angular-eslint/schematics": "15.1.0",
"@angular-eslint/template-parser": "15.1.0",
"@angular/cli": "15.0.3",
"@angular/compiler-cli": "15.0.3",
"@commitlint/cli": "17.3.0",
"@commitlint/config-conventional": "17.3.0",
"@ng-apimock/base-client": "3.3.0",
"@ng-apimock/core": "3.6.0",
"@ng-apimock/protractor-plugin": "2.1.0",
"@angular/animations": "15.1.0",
"@angular/cdk": "15.1.0",
"@angular/common": "15.1.0",
"@angular/compiler": "15.1.0",
"@angular/core": "15.1.0",
"@angular/forms": "15.1.0",
"@angular/material": "15.1.0",
"@angular/platform-browser": "15.1.0",
"@angular/platform-browser-dynamic": "15.1.0",
"@angular/router": "15.1.0",
"@angular-devkit/build-angular": "15.1.1",
"@angular-eslint/builder": "15.2.0",
"@angular-eslint/eslint-plugin": "15.2.0",
"@angular-eslint/eslint-plugin-template": "15.2.0",
"@angular-eslint/schematics": "15.2.0",
"@angular-eslint/template-parser": "15.2.0",
"@angular/cli": "15.1.1",
"@angular/compiler-cli": "15.1.0",
"@commitlint/cli": "17.4.2",
"@commitlint/config-conventional": "17.4.2",
"@ng-apimock/base-client": "3.3.1",
"@ng-apimock/core": "3.6.1",
"@ng-apimock/protractor-plugin": "2.1.1",
"@semantic-release/changelog": "6.0.2",
"@semantic-release/commit-analyzer": "9.0.2",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "8.0.7",
"@semantic-release/npm": "9.0.1",
"@semantic-release/npm": "9.0.2",
"@semantic-release/release-notes-generator": "10.0.3",
"@types/chai": "4.3.4",
"@types/cucumber": "6.0.1",
"@types/jest": "29.2.4",
"@types/node": "18.11.12",
"@typescript-eslint/eslint-plugin": "5.46.0",
"@typescript-eslint/parser": "5.46.0",
"@types/jest": "29.2.5",
"@types/node": "18.11.18",
"@typescript-eslint/eslint-plugin": "5.48.1",
"@typescript-eslint/parser": "5.48.1",
"angular2-prettyjson": "3.0.1",
"body-parser": "1.20.1",
"chai": "4.3.7",
"commitizen": "4.2.6",
"cucumber": "6.0.5",
"eslint": "8.29.0",
"eslint": "8.32.0",
"express": "4.18.2",
"husky": "8.0.2",
"husky": "8.0.3",
"jest": "29.3.1",
"jest-createspyobj": "2.0.0",
"jest-preset-angular": "12.2.3",
"lint-staged": "13.1.0",
"p-iteration": "1.1.8",
"protractor": "7.0.0",
"protractor-cucumber-framework": "8.4.4",
"rimraf": "3.0.2",
"rxjs": "7.6.0",
"semantic-release": "19.0.5",
"protractor-cucumber-framework": "9.0.0",
"rimraf": "4.0.6",
"rxjs": "7.8.0",
"semantic-release": "20.0.2",
"tslib": "2.4.1",
"ts-node": "10.9.1",
"typescript": "4.9.4",
"wait-on": "6.0.1",
"wait-on": "7.0.1",
"zone.js": "~0.12.0"
},
"lint-staged": {
Expand Down
4 changes: 2 additions & 2 deletions src/app/mocks/overview/overview.component.html
Expand Up @@ -32,8 +32,8 @@ <h2>Available mocks</h2>
<mat-cell *matCellDef="let element">
<mat-select name="{{element.name}}" [(ngModel)]="state[element.name].scenario"
(selectionChange)="this.scenario$.next(element.name)">
<mat-option *ngFor="let response of element.responses" [value]="response"
[innerHtml]="response"></mat-option>
<mat-option *ngFor="let response of element.responses" [value]="response">
{{response}}</mat-option>
<mat-option value="passThrough" class="">passThrough</mat-option>
</mat-select>
</mat-cell>
Expand Down
6 changes: 3 additions & 3 deletions src/app/mocks/overview/overview.component.po.ts
Expand Up @@ -33,7 +33,7 @@ export class MocksOverviewPo {
}

static row(index: number): MocksOverviewRowPo {
return new MocksOverviewRowPo($(CONTAINER_SELECTOR).$$('.mat-row').get(index));
return new MocksOverviewRowPo($(CONTAINER_SELECTOR).$$('.mat-mdc-row').get(index));
}

static async selectScenario(name: string, scenario: string): Promise<void> {
Expand All @@ -42,7 +42,7 @@ export class MocksOverviewPo {
}

static find(name: string): MocksOverviewRowPo {
return new MocksOverviewRowPo($$('.mat-row')
return new MocksOverviewRowPo($$('.mat-mdc-row')
.filter(async el => {
const text = await el.$('.mat-column-name').getText();
return text === name;
Expand Down Expand Up @@ -71,7 +71,7 @@ export class MocksOverviewRowPo {
}

get scenario(): any {
return this.container.$('.mat-select-value-text').getText();
return this.container.$('.mat-mdc-select-value-text').getText();
}

async delayResponse(delay: string): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions src/app/presets/create-preset/create-preset-component.po.ts
Expand Up @@ -6,11 +6,11 @@ export class CreatePresetPo {
await $('.name').sendKeys(name);

if (excludeMocks) {
await $('.excludeMocks').$('.mat-checkbox-inner-container').click();
await $('.excludeMocks').$('.mdc-checkbox__native-control').click();
}

if (excludeVariables) {
await $('.excludeVariables').$('.mat-checkbox-inner-container').click();
await $('.excludeVariables').$('.mdc-checkbox__native-control').click();
}

await element(by.buttonText('Create')).click();
Expand Down
1 change: 1 addition & 0 deletions src/app/presets/create-preset/create-preset.component.scss
Expand Up @@ -6,6 +6,7 @@
.container {
display: flex;
flex-direction: column;
padding: 20px;
}

.container > * {
Expand Down
4 changes: 2 additions & 2 deletions src/app/presets/overview/overview.component.po.ts
Expand Up @@ -25,11 +25,11 @@ export class PresetsOverviewPo {
}

static row(index: number): PresetsOverviewRowPo {
return new PresetsOverviewRowPo($(CONTAINER_SELECTOR).$$('.mat-row').get(index));
return new PresetsOverviewRowPo($(CONTAINER_SELECTOR).$$('.mat-mdc-row').get(index));
}

static find(name: string): PresetsOverviewRowPo {
return new PresetsOverviewRowPo($$('.mat-row')
return new PresetsOverviewRowPo($$('.mat-mdc-row')
.filter(async el => {
const text = await el.$('.mat-column-name').getText();
return text === name;
Expand Down
4 changes: 2 additions & 2 deletions src/app/variables/overview/overview.component.po.ts
Expand Up @@ -25,11 +25,11 @@ export class VariablesOverviewPo {
}

static row(index: number): VariablesOverviewRowPo {
return new VariablesOverviewRowPo($(CONTAINER_SELECTOR).$$('.mat-row').get(index));
return new VariablesOverviewRowPo($(CONTAINER_SELECTOR).$$('.mat-mdc-row').get(index));
}

static find(name: string): VariablesOverviewRowPo {
return new VariablesOverviewRowPo($$('.mat-row')
return new VariablesOverviewRowPo($$('.mat-mdc-row')
.filter(async el => {
const text = await el.$('.mat-column-key').getText();
return text === name;
Expand Down

0 comments on commit 53f3f4e

Please sign in to comment.