summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_common_components/commit_spec.js.es6
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-10 18:58:35 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-16 11:58:13 +0000
commit30c6a7d3acf658253af158ff7069081cf4b109ad (patch)
tree5c73598837b5d3ed986835bdfe2b2c33330acb8f /spec/javascripts/vue_common_components/commit_spec.js.es6
parent8cebb71e0a615341b6d3b17214dade0c8c094287 (diff)
downloadgitlab-ce-30c6a7d3acf658253af158ff7069081cf4b109ad.tar.gz
Adds tests
Adds tests. Changes instance into a constructor Adds tests for environments component Adds tests assertations Adds external URL test Adds tests for Rollback component Adds tests for stop component Adds tests for actions component Fix environment item Init environment item tests
Diffstat (limited to 'spec/javascripts/vue_common_components/commit_spec.js.es6')
-rw-r--r--spec/javascripts/vue_common_components/commit_spec.js.es689
1 files changed, 89 insertions, 0 deletions
diff --git a/spec/javascripts/vue_common_components/commit_spec.js.es6 b/spec/javascripts/vue_common_components/commit_spec.js.es6
new file mode 100644
index 00000000000..4f158e8ffa5
--- /dev/null
+++ b/spec/javascripts/vue_common_components/commit_spec.js.es6
@@ -0,0 +1,89 @@
+/*= require vue_common_components/commit */
+/* eslint-disable */
+
+describe('Commit component', () => {
+ const getRenderedText = (Component, propsData) => {
+ const Constructor = Vue.extend(Component);
+ const vm = new Constructor({propsData}).$mount();
+ return vm.$el.textContent;
+ };
+
+ const MyComponent = window.gl.commitComponent;
+
+ describe('When `ref` is provided', () => {
+ const props = {
+ tag: true,
+ ref: {
+ name: 'master',
+ ref_url: 'http://localhost/namespace2/gitlabhq/tree/master'
+ },
+ commit_url: 'https://gitlab.com/gitlab-org/gitlab-ce/commit/b7836eddf62d663c665769e1b0960197fd215067',
+ short_sha: 'b7836edd',
+ title: 'Commit message',
+ author: {
+ avatar_url: 'https://gitlab.com/uploads/user/avatar/300478/avatar.png',
+ web_url: 'https://gitlab.com/jschatz1',
+ username: 'jschatz1'
+ }
+ };
+
+ it('should render a tag icon if it represents a tag', () => {
+ const renderedText = getRenderedText(MyComponent, props);
+
+ });
+
+ it('should render a code-fork icon if it does not represent a tag', () => {
+
+ });
+
+ it('should render a link to the ref url', () => {
+
+ });
+
+ it('should render the ref name', () => {
+
+ });
+ });
+});
+
+it('should render the commit icon as an svg', () => {
+
+});
+
+it('should render the commit short sha with a link to the commit url', () => {
+
+});
+
+describe('Given commit title and author props', () => {
+ it('Should render a link to the author profile', () => {
+
+ });
+
+ it('Should render the author avatar with title and alt attributes', () => {
+
+ });
+});
+
+describe('When commit title is not provided', () => {
+ it('Should render default message', () => {
+
+ });
+});
+
+describe('Given no ref prop', () => {
+ it('Should render without errors', () => {
+
+ });
+});
+
+describe('Given no title prop', () => {
+ it('Should render without errors', () => {
+
+ });
+});
+
+describe('Given no author prop', () => {
+ it('Should render without errors', () => {
+
+ });
+}); \ No newline at end of file