DSingh0304 commented on code in PR #3277:
URL: https://github.com/apache/apisix-dashboard/pull/3277#discussion_r2869514453


##########
e2e/tests/upstreams.empty-discovery-args.spec.ts:
##########
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { upstreamsPom } from '@e2e/pom/upstreams';
+import { e2eReq } from '@e2e/utils/req';
+import { test } from '@e2e/utils/test';
+import { uiHasToastMsg } from '@e2e/utils/ui';
+import { expect } from '@playwright/test';
+
+import { deleteAllUpstreams, putUpstreamReq } from '@/apis/upstreams';
+import { API_UPSTREAMS } from '@/config/constant';
+import type { APISIXType } from '@/types/schema/apisix';
+
+/**
+ * Test that editing an upstream with service discovery and empty 
discovery_args
+ * does not cause the discovery_args field to be dropped.
+ * Regression test for: https://github.com/apache/apisix-dashboard/issues/3270
+ */
+const upstream: APISIXType['Upstream'] = {
+    id: 'upstream_discovery_test',
+    name: 'upstream_discovery_test',
+    desc: 'Upstream with service discovery',
+    discovery_type: 'nacos',
+    service_name: 'test-service',
+    discovery_args: {},
+};
+
+test.beforeAll(async () => {
+    await deleteAllUpstreams(e2eReq);
+    await putUpstreamReq(e2eReq, upstream);
+});
+

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to