-
Notifications
You must be signed in to change notification settings - Fork 72
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
🦾 525 adding versioning and edit mode for test definitions #575
🦾 525 adding versioning and edit mode for test definitions #575
Conversation
@@ -123,4 +125,41 @@ describe('Create Assertion', () => { | |||
cy.get('[data-cy=assertion-card-list]').should('be.visible'); | |||
cy.get('[data-cy=assertion-card]').should('have.lengthOf', 2); | |||
}); | |||
|
|||
it('should publish the changes', () => { |
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.
More tests!
@@ -42,10 +46,12 @@ const AssertionCard: React.FC<TAssertionCardProps> = ({ | |||
</S.SelectorListText> | |||
<S.SpanCountText>{spanCountText}</S.SpanCountText> | |||
</div> | |||
<div> | |||
<S.ActionsContainer> |
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.
We are now showing the draft and deleted tags
@@ -0,0 +1,22 @@ | |||
import {Modal} from 'antd'; |
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.
We are now alerting the user that there is a version mismatch before opening the assertion form
return ( | ||
<Context.Provider value={contextValue}> | ||
{children} | ||
<AssertionFormConfirmModal |
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.
Adding the confirm modal
return ( | ||
<S.TestHeader> | ||
<S.Content> | ||
<S.BackIcon data-cy="test-header-back-button" onClick={onBack} /> | ||
<S.TestName data-cy="test-details-name">{name}</S.TestName> | ||
<S.TestName data-cy="test-details-name"> |
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.
Versions!
|
||
const TraceActions: React.FC = () => { | ||
const {definitionList, publish, cancel} = useTestDefinition(); | ||
const pendingCount = definitionList.filter(({isDraft}) => isDraft).length; |
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.
New edit actions content.
open({ | ||
isEditing: false, | ||
defaultValues: { | ||
selectorList: |
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.
opening the assertion form with the selected span details
<TestDefinitionProvider testId={testId} runId={runId}> | ||
<AssertionFormProvider testId={testId}> | ||
<TestRunProvider testId={testId} runId={runId}> | ||
<TestRunProvider testId={testId} runId={runId}> |
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.
Moving the providers as some of them have dependencies
|
||
const update = useCallback( |
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.
Clean up, moving things to hooks and adding side effects
const reset = useCallback(() => { | ||
dispatch(resetAction()); | ||
}, [dispatch]); | ||
|
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.
Test Definition Slice proxy actions
export type TCrudResponse = { | ||
definitionList: TTestDefinitionEntry[]; | ||
change: TChange; | ||
}; | ||
|
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.
Leaving the async ones here, the rest are moved to the slice
|
||
const TestSelectors = () => ({ | ||
selectDefinitionList, | ||
selectIsLoading: createSelector(stateSelector, ({isLoading}) => isLoading), |
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.
Moar selectors
@@ -6,6 +6,13 @@ export type TRawTestDefinition = TTestSchemas['TestDefinition']; | |||
export type TTestDefinitionEntry = { | |||
selector: string; | |||
assertionList: TAssertion[]; | |||
isDraft: boolean; |
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.
Added draft and deleted booleans so we can display them on the cards
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.
That is a lot of code! Skimmed through it - will be great functionality!!
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.
LGTM
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.
🔥
})); | ||
}; | ||
|
||
const counterSlice = createSlice({ |
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.
testDefinitionSlice
?
This PR adds versioning to the FE and enables users to draft changes until they are ready to publish or if they want to revert all to the previous state.
Changes
Fixes
Checklist