Skip to content

Commit

Permalink
Added documentation and a test for the styles preview page (#1045)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelynch authored Nov 11, 2024
1 parent a440b88 commit 85e9f7f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,9 @@ Instead, use the capistrano task, which will open an ssh tunnel to all nodes in

Workers must be running on each server in order for mail to be sent and background jobs to be run.
The sidekiq workers are run on the server via a service, `tiger-data-workers`. To see the status on the workers on the server run `sudo service tiger-data-workers status`. You can restart the workers by running `sudo service tiger-data-workers restart`.

## Website Styles Preview Page

To demonstrate the look and feel of elements defined as part of the style guide, this application includes a "styles preview" page, visible at the path `/styles_preview`. It is intended as a place to make CSS and HTML attributes available for review by users either before they are implemented in the UI, or are difficult to access within the UI of the rest of the application, but the look and feel must be reviewed. See [this ticket](https://github.com/pulibrary/tigerdata-app/issues/1000) as an example of CSS that is also added to the Styles Preview page as part of development.

All elements on the Styles Preview page are added manually during feature development, and only need to be added if they match the criteria described above (either not yet in the UI or difficult to access otherwise within the UI). It can be edited at [`app/views/welcome/styles_preview.html.erb`](https://github.com/pulibrary/tigerdata-app/blob/main/app/views/welcome/styles_preview.html.erb).
21 changes: 21 additions & 0 deletions spec/system/styles_preview_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require "rails_helper"

describe "Styles Preview page", type: :system, connect_to_mediaflux: false, js: true do
context "unauthenticated user" do
it "shows the 'Log In' button" do
visit "/styles_preview"
expect(page).to have_content "Log in"
end
end

context "authenticated user" do
let(:current_user) { FactoryBot.create(:user, uid: "pul123") }
it "shows the Styles Preview message" do
sign_in current_user
visit "/styles_preview"
expect(page).to have_content "This page shows the styles that have been implemented for this site's look and feel."
end
end
end

0 comments on commit 85e9f7f

Please sign in to comment.