Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUIC-1590-widget-markdown-card #279

Merged
merged 40 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3a7443a
Initial Markdown Card
johnniedfeldt Jul 13, 2022
0b2f05e
Merge branch 'master' into QUIC-1590-widget-markdown-card
johnniedfeldt Jul 13, 2022
3f29696
Update story controls
johnniedfeldt Jul 13, 2022
fadd8eb
Fix StoryBook MarkdownCard Basic.
johnniedfeldt Jul 13, 2022
50cfd26
fix: resolve ts error
Jul 14, 2022
cc49dc6
Basic Markdown Card Styling
johnniedfeldt Jul 14, 2022
a0c858a
Markdown styling changes. Added different heading text sizes based on…
johnniedfeldt Jul 14, 2022
f151578
Updated <hr> rendering for markdowncard
johnniedfeldt Jul 14, 2022
2bf292c
Heading styling update. Sub lists styled. Checkboxes implemented.
johnniedfeldt Jul 14, 2022
23ff243
Updated structure to make it easier to add Markdown. There is some is…
johnniedfeldt Jul 14, 2022
3a806e8
Minor adjustments
johnniedfeldt Jul 14, 2022
2094098
Update src/components/ContentCards/ContentCards.tsx
johnniedfeldt Jul 19, 2022
8ee6594
Add Heading size prop
johnniedfeldt Jul 19, 2022
7883841
Merge branch 'master' into QUIC-1590-widget-markdown-card
johnniedfeldt Jul 19, 2022
ddc459e
Reduced version of react-markdown for compatibility reasons and to fi…
johnniedfeldt Jul 20, 2022
f2cfb3f
Fix test issue.
johnniedfeldt Jul 20, 2022
d3ea33f
Added remark-gfm back in for Github Markdown support.
johnniedfeldt Jul 20, 2022
3c62a08
Added more test cases.
johnniedfeldt Jul 20, 2022
e064603
PR Comment resolutions.
johnniedfeldt Jul 20, 2022
b9b6a60
Ran prettier and added prettier check to husky.
johnniedfeldt Jul 20, 2022
b1581c5
More PR changes
johnniedfeldt Jul 21, 2022
c249c88
Remove unused import
johnniedfeldt Jul 21, 2022
d7030f3
Adjusted Table and code styling. Change Heading size implementation.
johnniedfeldt Jul 22, 2022
ee35db7
Change default text size
johnniedfeldt Jul 22, 2022
09ec822
Revert husky pre-commit
johnniedfeldt Jul 22, 2022
cfa70dd
Minor font changes
johnniedfeldt Jul 22, 2022
fe58d77
Merge branch 'master' into QUIC-1590-widget-markdown-card
johnniedfeldt Jul 22, 2022
9c7de3c
Update src/components/Heading/Heading.tsx
johnniedfeldt Jul 22, 2022
1a21387
Fixed lint issues. Still have 3 warnings in MarkdownCard.tsx
johnniedfeldt Jul 22, 2022
ffe1b31
Added markdown test. Markdown block does not show for some reason, bu…
johnniedfeldt Jul 25, 2022
dec0179
possible debug updates for package.json
johnniedfeldt Jul 25, 2022
13bc6d6
react-markdown updated to lates. Cypress now works for Markdown card.
johnniedfeldt Jul 27, 2022
079d819
Jest fix
johnniedfeldt Jul 27, 2022
6bc5468
Minor PR fixes
johnniedfeldt Jul 27, 2022
edea7be
PR comment implementations
johnniedfeldt Jul 28, 2022
c7487f3
Remove unused test
johnniedfeldt Jul 28, 2022
d8ca1cf
Fix unused variable warnings
johnniedfeldt Jul 28, 2022
f5e255f
Remove extra unused variable
johnniedfeldt Jul 28, 2022
7b7bc7f
Minor fixes
johnniedfeldt Jul 28, 2022
ccd539d
Merge branch 'master' into QUIC-1590-widget-markdown-card
johnniedfeldt Jul 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions __mocks__/react-markdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
// eslint-disable
johnniedfeldt marked this conversation as resolved.
Show resolved Hide resolved
// @ts-ignore
johnniedfeldt marked this conversation as resolved.
Show resolved Hide resolved
function ReactMarkdown({ children }) {
return <>{children}</>;
}

export default ReactMarkdown;
// eslint-enable
9 changes: 9 additions & 0 deletions __mocks__/remark-gfm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
// eslint-disable
// @ts-ignore
function remarkGfm({ children }) {
return <>{children}</>;
}

export default remarkGfm;
// eslint-enable
8 changes: 8 additions & 0 deletions cypress/e2e/content-cards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ describe('content cards', () => {
imageCard: '46',
externalLink: '48',
internalLink: '48c',
markdownCard: '49',
};

before(() => {
Expand Down Expand Up @@ -38,4 +39,11 @@ describe('content cards', () => {
cy.get('button').contains('svg', 'Hide card').click();
cy.get('[data-sm-content=internalLink]').should('not.exist');
});

it('renders a Markdown Card and hides the card once the close button is clicked', () => {
cy.sendTextMessage(corpusCommands.markdownCard);
cy.get('[data-sm-content=markdown]', { timeout: 6000 }).should('exist');
cy.get('button').contains('svg', 'Hide card').click();
cy.get('[data-sm-content=markdown]').should('not.exist');
});
});
johnniedfeldt marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module.exports = {
'^react-dom/test-utils$': 'preact/test-utils',
'^react-dom$': 'preact/compat',
'^react/jsx-runtime$': 'preact/jsx-runtime',
'react-markdown': '<rootDir>/__mocks__/react-markdown.tsx',
johnniedfeldt marked this conversation as resolved.
Show resolved Hide resolved
'remark-gfm': '<rootDir>/__mocks__/remark-gfm.tsx',
},

globals: {
Expand Down
Loading