Commit 8b931547 authored by Thomas Randolph's avatar Thomas Randolph Committed by Igor Drozdov

Update last commit tests and snapshots

Also translates some bare text and removes a linter override
parent 048c1130
<script> <script>
/* eslint-disable @gitlab/vue-i18n/no-bare-strings */
import { GlTooltipDirective, GlLink, GlButton, GlLoadingIcon } from '@gitlab/ui'; import { GlTooltipDirective, GlLink, GlButton, GlLoadingIcon } from '@gitlab/ui';
import { sprintf, s__ } from '~/locale'; import { sprintf, s__ } from '~/locale';
import Icon from '../../vue_shared/components/icon.vue'; import Icon from '../../vue_shared/components/icon.vue';
...@@ -113,7 +112,7 @@ export default { ...@@ -113,7 +112,7 @@ export default {
> >
{{ commit.author.name }} {{ commit.author.name }}
</gl-link> </gl-link>
authored {{ s__('LastCommit|authored') }}
<timeago-tooltip :time="commit.authoredDate" tooltip-placement="bottom" /> <timeago-tooltip :time="commit.authoredDate" tooltip-placement="bottom" />
</div> </div>
<pre <pre
......
...@@ -9227,6 +9227,9 @@ msgstr "" ...@@ -9227,6 +9227,9 @@ msgstr ""
msgid "Last used on:" msgid "Last used on:"
msgstr "" msgstr ""
msgid "LastCommit|authored"
msgstr ""
msgid "LastPushEvent|You pushed to" msgid "LastPushEvent|You pushed to"
msgstr "" msgstr ""
......
...@@ -60,6 +60,111 @@ exports[`Repository last commit component renders commit widget 1`] = ` ...@@ -60,6 +60,111 @@ exports[`Repository last commit component renders commit widget 1`] = `
<div <div
class="commit-actions flex-row" class="commit-actions flex-row"
> >
<!---->
<gllink-stub
class="js-commit-pipeline"
data-original-title="Commit: failed"
href="https://test.com/pipeline"
title=""
>
<ciicon-stub
aria-label="Commit: failed"
cssclasses=""
size="24"
status="[object Object]"
/>
</gllink-stub>
<div
class="commit-sha-group d-flex"
>
<div
class="label label-monospace monospace"
>
12345678
</div>
<clipboardbutton-stub
cssclass="btn-default"
text="123456789"
title="Copy commit SHA to clipboard"
tooltipplacement="bottom"
/>
</div>
</div>
</div>
</div>
`;
exports[`Repository last commit component renders the signature HTML as returned by the backend 1`] = `
<div
class="info-well d-none d-sm-flex project-last-commit commit p-3"
>
<useravatarlink-stub
class="avatar-cell"
imgalt=""
imgcssclasses=""
imgsize="40"
imgsrc="https://test.com"
linkhref="https://test.com/test"
tooltipplacement="top"
tooltiptext=""
username=""
/>
<div
class="commit-detail flex-list"
>
<div
class="commit-content qa-commit-content"
>
<gllink-stub
class="commit-row-message item-title"
href="https://test.com/commit/123"
>
Commit title
</gllink-stub>
<!---->
<div
class="committer"
>
<gllink-stub
class="commit-author-link js-user-link"
href="https://test.com/test"
>
Test
</gllink-stub>
authored
<timeagotooltip-stub
cssclass=""
time="2019-01-01"
tooltipplacement="bottom"
/>
</div>
<!---->
</div>
<div
class="commit-actions flex-row"
>
<div>
<button>
Verified
</button>
</div>
<gllink-stub <gllink-stub
class="js-commit-pipeline" class="js-commit-pipeline"
data-original-title="Commit: failed" data-original-title="Commit: failed"
......
...@@ -107,4 +107,10 @@ describe('Repository last commit component', () => { ...@@ -107,4 +107,10 @@ describe('Repository last commit component', () => {
expect(vm.find('.commit-row-description').isVisible()).toBe(true); expect(vm.find('.commit-row-description').isVisible()).toBe(true);
expect(vm.find('.text-expander').classes('open')).toBe(true); expect(vm.find('.text-expander').classes('open')).toBe(true);
}); });
it('renders the signature HTML as returned by the backend', () => {
factory(createCommitData({ signatureHtml: '<button>Verified</button>' }));
expect(vm.element).toMatchSnapshot();
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment