mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
REVERT: "DEV: Convert admin API keys to conform to UI guidelines"
This reverts commit d9ddc258089da0f6cd8cf75af385c8a59eeccac3. I noticed that Webhook admin UI is now inaccessible through the subheader
This commit is contained in:

committed by
GitHub

parent
2ff511a4e4
commit
4da7904ffd
@ -1,65 +0,0 @@
|
||||
#frozen_string_literal: true
|
||||
|
||||
describe "Admin API Keys Page", type: :system do
|
||||
fab!(:current_user) { Fabricate(:admin) }
|
||||
|
||||
let(:api_keys_page) { PageObjects::Pages::AdminApiKeys.new }
|
||||
let(:dialog) { PageObjects::Components::Dialog.new }
|
||||
|
||||
before do
|
||||
Fabricate(:api_key, description: "Integration")
|
||||
|
||||
sign_in(current_user)
|
||||
end
|
||||
|
||||
it "shows a list of API keys" do
|
||||
api_keys_page.visit_page
|
||||
|
||||
expect(api_keys_page).to have_api_key_listed("Integration")
|
||||
end
|
||||
|
||||
it "can add a new API key" do
|
||||
api_keys_page.visit_page
|
||||
api_keys_page.add_api_key(description: "Second Integration")
|
||||
|
||||
expect(api_keys_page).to have_api_key_listed("Second Integration")
|
||||
end
|
||||
|
||||
it "can edit existing API keys" do
|
||||
api_keys_page.visit_page
|
||||
api_keys_page.click_edit("Integration")
|
||||
api_keys_page.edit_description("Old Integration")
|
||||
api_keys_page.click_back
|
||||
|
||||
expect(api_keys_page).to have_api_key_listed("Old Integration")
|
||||
end
|
||||
|
||||
it "can revoke API keys" do
|
||||
api_keys_page.visit_page
|
||||
api_keys_page.click_edit("Integration")
|
||||
api_keys_page.click_revoke
|
||||
api_keys_page.click_back
|
||||
|
||||
expect(api_keys_page).to have_revoked_api_key_listed("Integration")
|
||||
end
|
||||
|
||||
it "can undo revokation of API keys" do
|
||||
api_keys_page.visit_page
|
||||
api_keys_page.click_edit("Integration")
|
||||
api_keys_page.click_revoke
|
||||
api_keys_page.click_unrevoke
|
||||
api_keys_page.click_back
|
||||
|
||||
expect(api_keys_page).to have_unrevoked_api_key_listed("Integration")
|
||||
end
|
||||
|
||||
it "can permanently delete revoked API keys" do
|
||||
api_keys_page.visit_page
|
||||
api_keys_page.click_edit("Integration")
|
||||
api_keys_page.click_revoke
|
||||
api_keys_page.click_delete
|
||||
|
||||
expect(api_keys_page).to have_current_path("/admin/api/keys")
|
||||
expect(api_keys_page).to have_no_api_key_listed("Integration")
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user