-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
576 additions
and
948 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/app/child-dev-project/attendance/edit-attendance/edit-attendance.component.html
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
29 changes: 0 additions & 29 deletions
29
...p/core/basic-datatypes/entity-array/edit-entity-array/edit-entity-array.component.spec.ts
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
...ty-array/edit-entity-array.component.html → ...ay/edit-entity/edit-entity.component.html
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,10 +1,9 @@ | ||
<app-entity-select | ||
[entityType]="entityName" | ||
[selection]="formControl.value" | ||
(selectionChange)="formControl.markAsDirty(); formControl.setValue($event)" | ||
[disabled]="formControl.disabled" | ||
[label]="label" | ||
[placeholder]="placeholder" | ||
[showEntities]="showEntities" | ||
[multi]="multi" | ||
[form]="formControl" | ||
> | ||
</app-entity-select> |
67 changes: 67 additions & 0 deletions
67
src/app/core/basic-datatypes/entity-array/edit-entity/edit-entity.component.spec.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,67 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; | ||
|
||
import { EditEntityComponent } from "./edit-entity.component"; | ||
import { Child } from "../../../../child-dev-project/children/model/child"; | ||
import { setupEditComponent } from "../../../entity/default-datatype/edit-component.spec"; | ||
import { MockedTestingModule } from "../../../../utils/mocked-testing.module"; | ||
import { ArrayDatatype } from "../../array/array.datatype"; | ||
import { EntityDatatype } from "../../entity/entity.datatype"; | ||
import { EntityArrayDatatype } from "../entity-array.datatype"; | ||
import { FormFieldConfig } from "../../../common-components/entity-form/FormConfig"; | ||
|
||
describe("EditEntityComponent", () => { | ||
let component: EditEntityComponent; | ||
let fixture: ComponentFixture<EditEntityComponent<any>>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [EditEntityComponent, MockedTestingModule.withState()], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(EditEntityComponent); | ||
component = fixture.componentInstance; | ||
setupEditComponent(component); | ||
component.entityName = Child.ENTITY_TYPE; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("should create", () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
function testMultiFlag( | ||
formFieldConfig: Partial<FormFieldConfig>, | ||
expectedMulti: boolean, | ||
) { | ||
component.multi = !expectedMulti; | ||
component.formFieldConfig = { id: "test", ...formFieldConfig }; | ||
component.ngOnInit(); | ||
expect(component.multi).toBe(expectedMulti); | ||
} | ||
|
||
it("should detect 'multi' select for array datatypes", () => { | ||
testMultiFlag( | ||
{ | ||
dataType: ArrayDatatype.dataType, | ||
innerDataType: EntityDatatype.dataType, | ||
}, | ||
true, | ||
); | ||
|
||
testMultiFlag( | ||
{ | ||
dataType: EntityArrayDatatype.dataType, | ||
}, | ||
true, | ||
); | ||
|
||
testMultiFlag( | ||
{ | ||
dataType: EntityDatatype.dataType, | ||
}, | ||
false, | ||
); | ||
}); | ||
}); |
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
26 changes: 0 additions & 26 deletions
26
src/app/core/basic-datatypes/entity/edit-single-entity/edit-single-entity.component.html
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/app/core/basic-datatypes/entity/edit-single-entity/edit-single-entity.component.scss
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.