-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show publishing api errors in publishing drawer #1367
Conversation
throw new Error("Invalid PublishingEnv") | ||
} | ||
|
||
const PublishingOption: React.FC<PublishingOptionProps> = props => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously a function defined in PublishingDrawer
, renderOption
, now a real component.
Codecov Report
@@ Coverage Diff @@
## master #1367 +/- ##
==========================================
+ Coverage 89.10% 94.46% +5.36%
==========================================
Files 232 111 -121
Lines 9733 3345 -6388
Branches 1843 795 -1048
==========================================
- Hits 8673 3160 -5513
+ Misses 932 177 -755
+ Partials 128 8 -120
Continue to review full report at Codecov.
|
import { makeWebsiteDetail } from "../util/factories/websites" | ||
import IntegrationTestHelper, { | ||
import IntegrationTestHelperOld, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something that IntegrationTestHelperOld
can test that the new one can't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. But the old one uses Enzyme, and the new one uses @testing-library/react
("RTL") (and other packges in the @testing-library
family). RTL has a somewhat different API than Enzyme, so converting tests will be a bit of effort.
I've been trying to write new tests with RTL + the new helper, and have been converting old tests when refactoring significantly. (Which is natural, since the Enzyme tests tend to be a bit brittle, so refactoring tends to break them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great, but looks like there is a conflict with master now so it needs a rebase.
c6f52bd
to
e8d03de
Compare
replace two more constants with enums
specifically: - use spyOn to mock makeRequest, rather than a global mock. The global mock was being problematic when other imports (e.g., the old integration test helper) was also mocking `makeRequest`. - add `mockGetWebsiteDetail` - make `helper.mockRequest` more flexible in its argument matching
e8d03de
to
fbf007d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Pre-Flight checklist
What are the relevant tickets?
#1366
What's this PR do?
This PR adds field-specific error messages to the publishing drawer, building on #1316
How should this be manually tested?
websitePublishAction
code from"preview"
to something invalid.Screenshots (if appropriate)
Before / After
