Skip to content

Commit

Permalink
Revert "feat(link): update link to encode essentials urls"
Browse files Browse the repository at this point in the history
This reverts commit 65484e8.
  • Loading branch information
bjnewman committed Nov 20, 2024
1 parent 29da78b commit b00b020
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
6 changes: 2 additions & 4 deletions packages/link/src/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import classNames from 'classnames';
import { isAbsoluteUrl } from '@availity/resolve-url';

// if absolute or loadApp is disabled, return url. otherwise loadappify the url
export const getUrl = (url = '', loadApp = false, absolute = false) => {
const isEssentials = /(test|qa(p?)-)?essentials\.availity\.com/.test(url);

if ((absolute || !loadApp) && !isEssentials) return url;
export const getUrl = (url = '', loadApp, absolute) => {
if (absolute || !loadApp) return url;

return `/public/apps/home/#!/loadApp?appUrl=${encodeURIComponent(url)}`;
};
Expand Down
21 changes: 0 additions & 21 deletions packages/link/tests/Link.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,25 +114,4 @@ describe('AvLink', () => {
expect(link).toHaveAttribute('class', 'link card-link');
expect(link).toHaveAttribute('style', 'font-weight: bold;');
});

test('should render urls from the test-essentials.availity.com domain correctly', () => {
const exampleHref = 'https://test-essentials.availity.com/static/avonly/post/cs/enhanced-claim-status-ui/';

const { getByTestId } = render(<AvLink href={exampleHref}>My App</AvLink>);

const tag = getByTestId('av-link-tag');
const expected = `/public/apps/home/#!/loadApp?appUrl=${encodeURIComponent(exampleHref)}`;

expect(tag.getAttribute('href')).toBe(expected);
});
test('should render urls from the qa-essentials.availity.com domain correctly', () => {
const exampleHref = 'https://qa-essentials.availity.com/static/avonly/post/cs/enhanced-claim-status-ui/';

const { getByTestId } = render(<AvLink href={exampleHref}>My App</AvLink>);

const tag = getByTestId('av-link-tag');
const expected = `/public/apps/home/#!/loadApp?appUrl=${encodeURIComponent(exampleHref)}`;

expect(tag.getAttribute('href')).toBe(expected);
});
});

0 comments on commit b00b020

Please sign in to comment.