Skip to content

Commit

Permalink
feat(Rewrite): @NgxSubForm() decorator is no longer needed and is not…
Browse files Browse the repository at this point in the history
… exported
  • Loading branch information
zakhenry committed Oct 23, 2020
1 parent ba2a391 commit a73d7e9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ describe(`NgxSubFormComponent`, () => {
numberTwo: number;
}

@Directive()
@Component({ template: '' })
class ValidatedSubComponent extends NgxSubFormComponent<Numbered> {
protected getFormControls() {
return {
Expand Down Expand Up @@ -486,7 +486,7 @@ describe(`NgxSubFormComponent`, () => {
passwordRepeat: string;
}

@Directive()
@Component({ template: '' })
class PasswordSubComponent extends NgxSubFormComponent<PasswordForm> {
protected getFormControls() {
return {
Expand Down
56 changes: 28 additions & 28 deletions src/app/app.spec.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ context(`EJawa demo`, () => {
DOM.list.elements.cy.eq(0).click();
DOM.list.elements.cy.eq(1).click();

const x = hardCodedListings[1] as VehicleListing;
const v = x.product as Speeder;
const vehicle = hardCodedListings[1] as VehicleListing;
const speeder = vehicle.product as Speeder;

const expectedObj: FormElement = {
title: x.title,
price: '£' + x.price.toLocaleString(),
title: vehicle.title,
price: '£' + vehicle.price.toLocaleString(),
inputs: {
id: x.id,
title: x.title,
imageUrl: x.imageUrl,
price: x.price + '',
listingType: x.listingType,
id: vehicle.id,
title: vehicle.title,
imageUrl: vehicle.imageUrl,
price: vehicle.price + '',
listingType: vehicle.listingType,
vehicleForm: {
vehicleType: x.product.vehicleType,
vehicleType: vehicle.product.vehicleType,
speederForm: {
color: v.color,
canFire: v.canFire,
crewMembers: v.crewMembers,
maximumSpeed: v.maximumSpeed,
color: speeder.color,
canFire: speeder.canFire,
crewMembers: speeder.crewMembers,
maximumSpeed: speeder.maximumSpeed,
},
},
},
Expand All @@ -95,25 +95,25 @@ context(`EJawa demo`, () => {
DOM.list.elements.cy.eq(1).click();
DOM.list.elements.cy.eq(0).click();

const x = hardCodedListings[0] as VehicleListing;
const s = x.product as Spaceship;
const vehicle = hardCodedListings[0] as VehicleListing;
const spaceship = vehicle.product as Spaceship;

const expectedObj: FormElement = {
title: x.title,
price: '£' + x.price.toLocaleString(),
title: vehicle.title,
price: '£' + vehicle.price.toLocaleString(),
inputs: {
id: x.id,
title: x.title,
imageUrl: x.imageUrl,
price: x.price + '',
listingType: x.listingType,
id: vehicle.id,
title: vehicle.title,
imageUrl: vehicle.imageUrl,
price: vehicle.price + '',
listingType: vehicle.listingType,
vehicleForm: {
vehicleType: x.product.vehicleType,
vehicleType: vehicle.product.vehicleType,
spaceshipForm: {
color: s.color,
canFire: s.canFire,
crewMembers: s.crewMembers,
wingCount: s.wingCount,
color: spaceship.color,
canFire: spaceship.canFire,
crewMembers: spaceship.crewMembers,
wingCount: spaceship.wingCount,
},
},
},
Expand Down

0 comments on commit a73d7e9

Please sign in to comment.