You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/08/12 01:29:48 UTC
[GitHub] [apisix-dashboard] Baoyuantop commented on a diff in pull request #2573: fix: drawer components delete plugin not working
Baoyuantop commented on code in PR #2573:
URL: https://github.com/apache/apisix-dashboard/pull/2573#discussion_r944051579
##########
web/src/pages/Plugin/PluginMarket.tsx:
##########
@@ -48,14 +48,18 @@ const PluginMarket: React.FC = () => {
initialData={initialData}
type="global"
schemaType="route"
- onChange={(pluginsData) => {
+ onChange={(pluginsData, pluginId, handleType) => {
createOrUpdate({
plugins: {
- ...initialData,
...pluginsData,
},
Review Comment:
If there is only one left, there is no need to expand the operation.
##########
web/cypress/integration/plugin/create-delete-in-drawer-plugin.spec.js:
##########
@@ -107,6 +109,48 @@ context('Delete Plugin List with the Drawer', () => {
cy.contains('button', 'Confirm').click({
force: true,
});
+ cy.get(selector.notification).should('contain', 'Delete Plugin Successfully');
+ cy.get(selector.notificationCloseIcon).click({ multiple: true });
+ cy.get(selector.empty).should('be.visible');
+ });
+
+ it('should delete the plugin with the drawer in the list of plugins', function () {
+ cy.visit('/plugin/list');
+ cy.get(selector.refresh).click();
+ cy.contains('Enable').click();
+
+ cy.contains(data.basicAuthPlugin)
+ .parents(selector.pluginCardBordered)
+ .within(() => {
+ cy.get('button').click({
+ force: true,
+ });
+ });
+ cy.get(selector.drawer)
+ .should('be.visible')
+ .within(() => {
+ cy.get(selector.disabledSwitcher).click();
+ cy.get(selector.checkedSwitcher).should('exist');
+ });
+ cy.contains('button', 'Submit').click();
+
+ cy.contains(data.basicAuthPlugin)
+ .parents(selector.pluginCardBordered)
+ .within(() => {
+ cy.get('button').click({
+ force: true,
+ });
+ });
+
+ cy.contains('button', 'Delete').click({
+ force: true,
+ });
+ cy.contains('button', 'Confirm').click({
+ force: true,
+ });
+ cy.get(selector.notification).should('contain', 'Delete Plugin Successfully');
+ cy.get(selector.notificationCloseIcon).click({ multiple: true });
Review Comment:
After that, we would better check that the plugin button is turned to `Enable` instead of `Edit`
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org