Skip to content

Commit

Permalink
fix: snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase committed Apr 18, 2022
1 parent f339a10 commit 24099c1
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 0 deletions.
43 changes: 43 additions & 0 deletions packages/core/__tests__/__snapshots__/cv-tabs.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CvTab matches with disabled and selected 1`] = `<div id="an-id" role="tabpanel" aria-labelledby="an-id-link" aria-hidden="false" class="cv-tab"></div>`;

exports[`CvTab matches with slotted content 1`] = `
<div id="an-id" role="tabpanel" aria-labelledby="an-id-link" aria-hidden="true" hidden="hidden" class="cv-tab">
<div class="stub"></div>
</div>
`;

exports[`CvTabs matches render 1`] = `
<div class="cv-tabs" style="width: 100%;">
<div data-tabs="" role="navigation" class="cv-tab bx--tabs--scrollable"><button aria-hidden="true" aria-label="scroll left" tabindex="-1" type="button" class="">
<chevronleft16-stub></chevronleft16-stub>
</button>
<div class="bx--tabs__overflow-indicator--left"></div>
<ul role="tablist" class="bx--tabs--scrollable__nav"></ul>
<div class="bx--tabs__overflow-indicator--right"></div> <button aria-hidden="true" aria-label="scroll right" tabindex="-1" type="button" class="">
<chevronright16-stub></chevronright16-stub>
</button>
</div>
<div class="cv-tabs__panels"></div>
</div>
`;

exports[`CvTabs matches with slotted content 1`] = `
<div class="cv-tabs" style="width: 100%;">
<div data-tabs="" role="navigation" class="cv-tab bx--tabs--scrollable"><button aria-hidden="true" aria-label="scroll left" tabindex="-1" type="button" class="">
<chevronleft16-stub></chevronleft16-stub>
</button>
<div class="bx--tabs__overflow-indicator--left"></div>
<ul role="tablist" class="bx--tabs--scrollable__nav"></ul>
<div class="bx--tabs__overflow-indicator--right"></div> <button aria-hidden="true" aria-label="scroll right" tabindex="-1" type="button" class="">
<chevronright16-stub></chevronright16-stub>
</button>
</div>
<div class="cv-tabs__panels">
<cv-tab-stub label="my-label">Some stuff</cv-tab-stub>
<cv-tab-stub label="my-label">Some stuff</cv-tab-stub>
<cv-tab-stub label="my-label">Some stuff</cv-tab-stub>
</div>
</div>
`;
109 changes: 109 additions & 0 deletions packages/core/__tests__/__snapshots__/cv-text-input.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CvTextInput should render correctly 1`] = `
<div class="cv-text-input bx--form-item bx--text-input-wrapper"><label for="1" class="bx--label">test label</label>
<div class="bx--text-input__field-wrapper">
<!---->
<!----> <input id="1" type="text" class="bx--text-input">
<!---->
</div>
<!---->
<!---->
<!---->
</div>
`;
exports[`CvTextInput should render correctly when helper text is provided 1`] = `
<div class="cv-text-input bx--form-item bx--text-input-wrapper"><label for="1" class="bx--label">test label</label>
<div class="bx--text-input__field-wrapper">
<!---->
<!----> <input id="1" type="text" class="bx--text-input">
<!---->
</div>
<!---->
<!---->
<div class="bx--form__helper-text">helper test message</div>
</div>
`;
exports[`CvTextInput should render correctly when helper text slot is provided 1`] = `
<div class="cv-text-input bx--form-item bx--text-input-wrapper"><label for="1" class="bx--label">test label</label>
<div class="bx--text-input__field-wrapper">
<!---->
<!----> <input id="1" type="text" class="bx--text-input">
<!---->
</div>
<!---->
<!---->
<div class="bx--form__helper-text">
<div class="helper-text-class">helper text slot</div>
</div>
</div>
`;
exports[`CvTextInput should render correctly when invalid message is provided 1`] = `
<div class="cv-text-input bx--form-item bx--text-input-wrapper"><label for="1" class="bx--label">test label</label>
<div class="bx--text-input__field-wrapper" data-invalid="true">
<warningfilled16-stub class="bx--text-input__invalid-icon"></warningfilled16-stub>
<!----> <input id="1" type="text" class="bx--text-input bx--text-input--invalid">
<!---->
</div>
<div class="bx--form-requirement">invalid test message</div>
<!---->
<!---->
</div>
`;
exports[`CvTextInput should render correctly when invalid message slot is provided 1`] = `
<div class="cv-text-input bx--form-item bx--text-input-wrapper"><label for="1" class="bx--label">test label</label>
<div class="bx--text-input__field-wrapper" data-invalid="true">
<warningfilled16-stub class="bx--text-input__invalid-icon"></warningfilled16-stub>
<!----> <input id="1" type="text" class="bx--text-input bx--text-input--invalid">
<!---->
</div>
<div class="bx--form-requirement">
<div class="invalid-message-class">invalid message slot</div>
</div>
<!---->
<!---->
</div>
`;
exports[`CvTextInput should render correctly when light theme is used 1`] = `
<div class="cv-text-input bx--form-item bx--text-input-wrapper"><label for="1" class="bx--label">test label</label>
<div class="bx--text-input__field-wrapper">
<!---->
<!----> <input id="1" type="text" class="bx--text-input bx--text-input--light">
<!---->
</div>
<!---->
<!---->
<!---->
</div>
`;
exports[`CvTextInput should render correctly when type is password and is not visible 1`] = `
<div class="cv-text-input bx--form-item bx--text-input-wrapper bx--password-input-wrapper"><label for="1" class="bx--label">test label</label>
<div class="bx--text-input__field-wrapper">
<!---->
<!----> <input id="1" data-toggle-password-visibility="true" type="password" class="bx--text-input bx--password-input"> <button type="button" class="bx--btn bx--text-input--password__visibility__toggle bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--bottom bx--tooltip--align-center"><span class="bx--assistive-text">Show password</span>
<view16-stub class="bx--icon-visibility-off"></view16-stub>
</button></div>
<!---->
<!---->
<!---->
</div>
`;
exports[`CvTextInput should render correctly when type is password and is visible 1`] = `
<div class="cv-text-input bx--form-item bx--text-input-wrapper bx--password-input-wrapper"><label for="1" class="bx--label">test label</label>
<div class="bx--text-input__field-wrapper">
<!---->
<!----> <input id="1" data-toggle-password-visibility="true" type="password" class="bx--text-input bx--password-input"> <button type="button" class="bx--btn bx--text-input--password__visibility__toggle bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--bottom bx--tooltip--align-center"><span class="bx--assistive-text">Show password</span>
<view16-stub class="bx--icon-visibility-off"></view16-stub>
</button></div>
<!---->
<!---->
<!---->
</div>
`;

0 comments on commit 24099c1

Please sign in to comment.