From dfe0fe58ef5c77384e2a4685b45fc9a07cef8ee1 Mon Sep 17 00:00:00 2001 From: ananzh Date: Wed, 4 Oct 2023 22:59:07 +0000 Subject: [PATCH] [Refactor] Remove angular code from plugin_functional and update tests * remove angular-based view from DocViewsPlugin * remove the test case that validates the display and content of the angular doc view Issue Resolve https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5020 Signed-off-by: ananzh --- .../doc_views_plugin/public/plugin.tsx | 20 ------------------- .../test_suites/doc_views/doc_views.ts | 9 --------- 2 files changed, 29 deletions(-) diff --git a/test/plugin_functional/plugins/doc_views_plugin/public/plugin.tsx b/test/plugin_functional/plugins/doc_views_plugin/public/plugin.tsx index 42bd59c39a81..00bc66566eef 100644 --- a/test/plugin_functional/plugins/doc_views_plugin/public/plugin.tsx +++ b/test/plugin_functional/plugins/doc_views_plugin/public/plugin.tsx @@ -28,36 +28,16 @@ * under the License. */ -import angular from 'angular'; import React from 'react'; import { Plugin, CoreSetup } from 'opensearch-dashboards/public'; import { DiscoverSetup } from '../../../../../src/plugins/discover/public'; -angular.module('myDocView', []).directive('myHit', () => ({ - restrict: 'E', - scope: { - hit: '=hit', - }, - template: '

{{hit._index}}

', -})); - function MyHit(props: { index: string }) { return

{props.index}

; } export class DocViewsPlugin implements Plugin { public setup(core: CoreSetup, { discover }: { discover: DiscoverSetup }) { - discover.docViews.addDocView({ - directive: { - controller: function MyController($injector: any) { - $injector.loadNewModules(['myDocView']); - }, - template: ``, - }, - order: 1, - title: 'Angular doc view', - }); - discover.docViews.addDocView({ component: (props) => { return ; diff --git a/test/plugin_functional/test_suites/doc_views/doc_views.ts b/test/plugin_functional/test_suites/doc_views/doc_views.ts index dff782dc6a78..4a25bed25256 100644 --- a/test/plugin_functional/test_suites/doc_views/doc_views.ts +++ b/test/plugin_functional/test_suites/doc_views/doc_views.ts @@ -44,19 +44,10 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide it('should show custom doc views', async () => { await testSubjects.click('docTableExpandToggleColumn'); - const angularTab = await find.byButtonText('Angular doc view'); const reactTab = await find.byButtonText('React doc view'); - expect(await angularTab.isDisplayed()).to.be(true); expect(await reactTab.isDisplayed()).to.be(true); }); - it('should render angular doc view', async () => { - const angularTab = await find.byButtonText('Angular doc view'); - await angularTab.click(); - const angularContent = await testSubjects.find('angular-docview'); - expect(await angularContent.getVisibleText()).to.be('logstash-2015.09.22'); - }); - it('should render react doc view', async () => { const reactTab = await find.byButtonText('React doc view'); await reactTab.click();