Skip to content

Commit

Permalink
[Misc] Update source engines route with isMetaEngine conditional
Browse files Browse the repository at this point in the history
- to match its corresponding nav link
  • Loading branch information
cee-chen committed Jul 7, 2021
1 parent 961eb7e commit 4932382
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('EngineRouter', () => {
...mockEngineValues,
dataLoading: false,
engineNotFound: false,
isMetaEngine: false,
canCrawl: false,
myRole: {},
};
Expand Down Expand Up @@ -176,7 +177,11 @@ describe('EngineRouter', () => {
});

it('renders a source engines view', () => {
setMockValues({ ...values, myRole: { canViewMetaEngineSourceEngines: true } });
setMockValues({
...values,
myRole: { canViewMetaEngineSourceEngines: true },
isMetaEngine: true,
});
const wrapper = shallow(<EngineRouter />);

expect(wrapper.find(SourceEngines)).toHaveLength(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export const EngineRouter: React.FC = () => {
} = useValues(AppLogic);

const { engineName: engineNameFromUrl } = useParams() as { engineName: string };
const { engineName, dataLoading, engineNotFound, canCrawl } = useValues(EngineLogic);
const { engineName, dataLoading, engineNotFound, isMetaEngine, canCrawl } = useValues(
EngineLogic
);
const { setEngineName, initializeEngine, pollEmptyEngine, stopPolling, clearEngine } = useActions(
EngineLogic
);
Expand Down Expand Up @@ -120,7 +122,7 @@ export const EngineRouter: React.FC = () => {
<SchemaRouter />
</Route>
)}
{canViewMetaEngineSourceEngines && (
{canViewMetaEngineSourceEngines && isMetaEngine && (
<Route path={META_ENGINE_SOURCE_ENGINES_PATH}>
<SourceEngines />
</Route>
Expand Down

0 comments on commit 4932382

Please sign in to comment.