diff --git a/src/amo/pages/Addon/index.js b/src/amo/pages/Addon/index.js index 28edd51b60e..5f03abe4107 100644 --- a/src/amo/pages/Addon/index.js +++ b/src/amo/pages/Addon/index.js @@ -344,38 +344,6 @@ export class AddonBase extends React.Component { ) : null; } - renderVersionReleaseNotes() { - const { addon, i18n, currentVersion } = this.props; - if (!addon) { - return null; - } - - if (!currentVersion || !currentVersion.releaseNotes) { - return null; - } - - const header = i18n.sprintf( - i18n.gettext('Release notes for %(addonVersion)s'), - { addonVersion: currentVersion.version }, - ); - const releaseNotes = sanitizeUserHTML(currentVersion.releaseNotes); - - const showMoreCardNotesName = 'AddonDescription-version-notes'; - - /* eslint-disable react/no-danger */ - return ( - -
- - ); - /* eslint-enable react/no-danger */ - } - renderCategorySuggestions(requiredVariant) { const { addon, clientApp, variant } = this.props; @@ -523,8 +491,6 @@ export class AddonBase extends React.Component { - {this.renderVersionReleaseNotes()} - {this.renderRecommendations()}
diff --git a/tests/unit/amo/pages/TestAddon.js b/tests/unit/amo/pages/TestAddon.js index e7f7a3d909f..5c245ab868f 100644 --- a/tests/unit/amo/pages/TestAddon.js +++ b/tests/unit/amo/pages/TestAddon.js @@ -1264,99 +1264,6 @@ describe(__filename, () => { }); }); - describe('version release notes', () => { - const renderWithVersion = (props = {}) => { - addon.current_version = { ...fakeVersion, ...props }; - renderWithAddon(); - }; - - it('is hidden when an add-on has not loaded yet', () => { - render(); - - expect( - screen.queryByClassName('AddonDescription-version-notes'), - ).not.toBeInTheDocument(); - }); - - it('is hidden when the add-on does not have a current version', () => { - addon.current_version = null; - renderWithAddon(); - - expect( - screen.queryByClassName('AddonDescription-version-notes'), - ).not.toBeInTheDocument(); - }); - - it('is hidden when the current version does not have release notes', () => { - renderWithVersion({ release_notes: null }); - - expect( - screen.queryByClassName('AddonDescription-version-notes'), - ).not.toBeInTheDocument(); - }); - - it('passes the expected contentId to ShowMoreCard', async () => { - expect( - await testContentId({ - addonProp: 'id', - addonPropValue: addon.id + 1, - cardClassName: 'AddonDescription-version-notes', - }), - ).toBeTruthy(); - }); - - it('shows the version string', () => { - const version = 'v1.4.5'; - renderWithVersion({ version }); - - expect(screen.getByText('Release notes for v1.4.5')).toBeInTheDocument(); - }); - - it('shows the release notes', () => { - const releaseNotes = 'Fixed some stuff'; - renderWithVersion({ - release_notes: createLocalizedString(releaseNotes), - }); - - expect(screen.getByText(releaseNotes)).toBeInTheDocument(); - }); - - it('allows some HTML tags', () => { - const releaseNotes = 'lots of bug fixes'; - renderWithVersion({ - release_notes: createLocalizedString(releaseNotes), - }); - - const notesCard = screen.getByClassName('AddonDescription-version-notes'); - - expect( - screen.getByTextAcrossTags('lots of bug fixes'), - ).toBeInTheDocument(); - expect(within(notesCard).getByTagName('b')).toHaveTextContent('lots'); - expect(within(notesCard).getByTagName('i')).toHaveTextContent('of'); - }); - - it('allows some ul-li tags', () => { - const releaseNotes = 'The List'; - renderWithVersion({ - release_notes: createLocalizedString(releaseNotes), - }); - - const notesCard = screen.getByClassName('AddonDescription-version-notes'); - - expect( - within(notesCard).getByTextAcrossTags('The Listonetwo'), - ).toBeInTheDocument(); - expect(within(notesCard).getByRole('list')).toBeInTheDocument(); - expect(within(notesCard).getAllByRole('listitem')[0]).toHaveTextContent( - 'one', - ); - expect(within(notesCard).getAllByRole('listitem')[1]).toHaveTextContent( - 'two', - ); - }); - }); - it('renders the site identifier as a data attribute', () => { renderWithAddon();