Skip to content

Commit

Permalink
Merge pull request #406 from openedx/KristinAoki/fix-accessibility-pa…
Browse files Browse the repository at this point in the history
…ge-link-env-variable

fix: variable name for the accessibility link
  • Loading branch information
KristinAoki authored Mar 8, 2024
2 parents 62bf038 + cff78e0 commit aa13b49
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TERMS_OF_SERVICE_URL=null
PRIVACY_POLICY_URL=null
SUPPORT_EMAIL=null
STUDIO_BASE_URL=http://localhost:18010
SHOW_ACCESSIBILITY_PAGE=false
ENABLE_ACCESSIBILITY_PAGE=false
ORDER_HISTORY_URL=localhost:1996/orders
REFRESH_ACCESS_TOKEN_ENDPOINT=http://localhost:18000/login_refresh
SEGMENT_KEY=null
Expand Down
4 changes: 2 additions & 2 deletions src/components/studio-footer/StudioFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ensureConfig([
'SUPPORT_EMAIL',
'SITE_NAME',
'STUDIO_BASE_URL',
'SHOW_ACCESSIBILITY_PAGE',
'ENABLE_ACCESSIBILITY_PAGE',
], 'Studio Footer component');

const StudioFooter = ({
Expand Down Expand Up @@ -105,7 +105,7 @@ const StudioFooter = ({
{intl.formatMessage(messages.privacyPolicyLinkLabel)}
</Hyperlink>
)}
{config.SHOW_ACCESSIBILITY_PAGE === 'true' && (
{config.ENABLE_ACCESSIBILITY_PAGE === 'true' && (
<Hyperlink
destination={`${config.STUDIO_BASE_URL}/accessibility`}
data-testid="accessibilityRequest"
Expand Down
4 changes: 2 additions & 2 deletions src/components/studio-footer/StudioFooter.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = {
SUPPORT_EMAIL: process.env.SUPPORT_EMAIL,
SITE_NAME: process.env.SITE_NAME,
STUDIO_BASE_URL: process.env.STUDIO_BASE_URL,
SHOW_ACCESSIBILITY_PAGE: process.env.SHOW_ACCESSIBILITY_PAGE,
ENABLE_ACCESSIBILITY_PAGE: process.env.ENABLE_ACCESSIBILITY_PAGE,
};

let currentConfig = config;
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('Footer', () => {
expect(screen.queryByTestId('accessibilityRequest')).toBeNull();
});
it('should show accessibilty request link', () => {
render(<Component updateVariable={['SHOW_ACCESSIBILITY_PAGE', 'true']} />);
render(<Component updateVariable={['ENABLE_ACCESSIBILITY_PAGE', 'true']} />);
expect(screen.getByText('LMS')).toBeVisible();
expect(screen.queryByTestId('termsOfService')).toBeNull();
expect(screen.queryByTestId('privacyPolicy')).toBeNull();
Expand Down
1 change: 1 addition & 0 deletions src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ process.env.LOGO_URL = 'https://edx-cdn.org/v3/default/logo.svg';
process.env.LOGO_TRADEMARK_URL = 'https://edx-cdn.org/v3/default/logo-trademark.svg';
process.env.LOGO_WHITE_URL = 'https://edx-cdn.org/v3/default/logo-white.svg';
process.env.FAVICON_URL = 'https://edx-cdn.org/v3/default/favicon.ico';
process.env.ENABLE_ACCESSIBILITY_PAGE = 'false';

0 comments on commit aa13b49

Please sign in to comment.