multiple
your still comparing objects to objects which I don't think works if the references aren't the same
Hello, I'm trying to write unit tests for a component and I keep getting this error Error: MatDatepicker: No provider found for DateAdapter. You must import one of the following modules at your application root: MatNativeDateModule, MatMomentDateModule, or provide a custom implementation.
My testbed :
describe('DateSelectComponent', () => {
// Define Testbed
let spectator: Spectator<DateSelectComponent>
const createComponent = createComponentFactory({
component: DateSelectComponent,
imports: [
MatFormFieldModule,
MatDatepickerModule,
CommonModule,
MatMomentDateModule,
MatInputModule,
TranslateModule.forRoot({
defaultLanguage: "ar",
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
],
providers: [
HttpClient,
{
provide: MAT_DATE_FORMATS,
useValue: MY_FORMATS
}
]
});
beforeEach(() => spectator = createComponent())
// Tests
it('Should load', () => {
expect(spectator.component).toBeTruthy()
})
})
import { MatFormFieldModule } from "@angular/material/form-field"
import { MatDatepickerModule } from "@angular/material/datepicker";
import { MatInputModule } from "@angular/material/input";
import { MatMomentDateModule } from "@angular/material-moment-adapter";
@Rini30
i am using drag and drop material ui for dragging an image all around.But i am facining an issue on how to drag and drop in into a next container?.I have defined a div tag and linked it.But still unable to drop the image.
Any help
here is the code
<div class="box1"
cdkDropList
#image="cdkDropList"
[cdkDropListConnectedTo]="[nextblock]"
(cdkDropListDropped)="drop($event)"
[cdkDropListData]="url">
<input type="file" (change)="fileChange($event)" placeholder="Upload file" >
<img #filter id="blah" [src]="url" alt="your image" cdkDrag/>
</div>
<div
class="box2"
cdkDropList
#nextblock="cdkDropList"
[cdkDropListConnectedTo]="[image]"
[cdkDropListData]="[filter2]"
(cdkDropListDropped)="drop($event)"
(cdkDropListEntered)="setColor()">
<img #filter2>
</div>
<div class="box2">Box 2</div>
<div class="box2">Box 3</div>
{}
(POJO)