mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-12 01:32:12 +00:00
test: inject instead of deprecated TestBed get
Additionally refactor tests and ts-ignore annotations.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion,@typescript-eslint/ban-ts-comment */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion, @typescript-eslint/ban-ts-comment */
|
||||
import {
|
||||
APP_BASE_HREF,
|
||||
CommonModule,
|
||||
@@ -103,7 +103,7 @@ describe('ContextMenuComponent', async () => {
|
||||
fixture.detectChanges();
|
||||
const sort: HTMLElement =
|
||||
fixture.debugElement.nativeElement.querySelector('.context-sort');
|
||||
// @ts-ignore
|
||||
// @ts-expect-error not relevant for this case
|
||||
const sortItem: HTMLElement = sort.querySelectorAll('.sort-item')[1];
|
||||
sortItem!.click();
|
||||
expect(instance.sortOption.value).toEqual('name');
|
||||
@@ -148,7 +148,7 @@ describe('ContextMenuComponent', async () => {
|
||||
|
||||
expect(filterGroup).toBeDefined();
|
||||
|
||||
// @ts-ignore
|
||||
// @ts-expect-error it is defined
|
||||
const filterItems = filterGroup.querySelectorAll('.filter-item-label');
|
||||
|
||||
if (filterItems.length !== facet.buckets.length) {
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('ContextMenuService', () => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [ContextMenuService],
|
||||
});
|
||||
service = TestBed.get(ContextMenuService);
|
||||
service = TestBed.inject(ContextMenuService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
|
||||
Reference in New Issue
Block a user