Logo on /new (#11701)

* tooltips 1.0.1

* tooltips 1.0.1

* logo on /new

* comment

* spec: Adds a test to ensure that the logo or Community name shows on /new

Co-authored-by: Julianna Tetreault <juliannatetreault@gmail.com>
This commit is contained in:
ludwiczakpawel 2020-12-03 08:55:40 +01:00 committed by GitHub
parent 8f5cfa2c0f
commit 69f7f4ba08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 2 deletions

View file

@ -3,8 +3,31 @@
padding-top: 0 !important;
}
.crayons-footer,
.crayons-header {
/* This weirdness below has a reason: https://github.com/forem/forem/pull/11701#issuecomment-737319289 */
.crayons-header,
.crayons-header * {
visibility: hidden;
position: absolute;
left: -9999em;
top: -9999em;
pointer-events: none;
opacity: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
}
.crayons-header .site-logo,
.crayons-header .site-logo * {
visibility: visible;
position: static;
pointer-events: auto;
opacity: 1;
clip: auto;
overflow: visible;
}
.crayons-footer {
display: none;
}

View file

@ -22,6 +22,16 @@ RSpec.describe "Using the editor", type: :system do
within("#article-form") { fill_in "article_body_markdown", with: content }
end
describe "Viewing the editor", js: true do
it "renders the logo_svg or Community name as expected" do
visit "/new"
expect(page).to have_css(".site-logo")
within(".truncate-at-2") do
expect(page).to have_text("DEV(local)")
end
end
end
describe "Previewing an article", js: true do
before do
fill_markdown_with(read_from_file(raw_text))