mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-31 02:19:47 +03:00
DOP-3612: modify labels for versioning (#30)
This commit is contained in:
parent
42e70be345
commit
176757f5ab
|
@ -60,7 +60,10 @@ export class Redoc extends React.Component<RedocProps> {
|
|||
backNavigationPath={options.backNavigationPath}
|
||||
siteTitle={options.siteTitle}
|
||||
/>
|
||||
<SideMenuTitle>{store.spec.info.title}</SideMenuTitle>
|
||||
<SideMenuTitle>
|
||||
{store.spec.info.title}
|
||||
{options.versionData && ` ${options.versionData.active.apiVersion}`}
|
||||
</SideMenuTitle>
|
||||
{(!options.disableSearch && (
|
||||
<SearchBox
|
||||
search={search!}
|
||||
|
|
|
@ -46,7 +46,7 @@ const VersionSelectorComponent = ({
|
|||
return (
|
||||
<StyledWrapper ref={menuListRef}>
|
||||
<StyledSelectWrapper>
|
||||
<StyledLabel>Version Selector: v{active.apiVersion}</StyledLabel>
|
||||
<StyledLabel>Resource Version:</StyledLabel>
|
||||
{description && <StyledDescription>{description}</StyledDescription>}
|
||||
<StyledButton onClick={() => setOpen(!open)}>
|
||||
<StyledDisplay>
|
||||
|
|
|
@ -22,9 +22,7 @@ describe('VersionSelector', () => {
|
|||
it('should correctly render VersionSelector', () => {
|
||||
const wrapper = render(<VersionSelector {...versionData} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
expect(wrapper.find('label').text()).toBe(
|
||||
`Version Selector: v${versionData.active.apiVersion}`,
|
||||
);
|
||||
expect(wrapper.find('label').text()).toBe(`Resource Version:`);
|
||||
expect(wrapper.find('button').text()).toBe(versionData.resourceVersions.slice(-1)[0]);
|
||||
});
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ exports[`VersionSelector should correctly render VersionSelector 1`] = `
|
|||
<label
|
||||
class="sc-eCApnc kkTJUz"
|
||||
>
|
||||
Version Selector: v2.0
|
||||
Resource Version:
|
||||
</label>
|
||||
<button
|
||||
aria-labelledby="View a different version of documentation."
|
||||
|
|
Loading…
Reference in New Issue
Block a user