<!DOCTYPE html>
<!--
Copyright (C) 2017 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>gr-repo</title>

<script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../../bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="../../../test/common-test-setup.html"/>
<link rel="import" href="gr-repo.html">

<script>void(0);</script>

<test-fixture id="basic">
  <template>
    <gr-repo></gr-repo>
  </template>
</test-fixture>

<script>
  suite('gr-repo tests', () => {
    let element;
    let sandbox;
    const REPO = 'test-repo';
    const SCHEMES = {http: {}, repo: {}, ssh: {}};

    function getFormFields() {
      const selects = Polymer.dom(element.root).querySelectorAll('select');
      const textareas =
          Polymer.dom(element.root).querySelectorAll('iron-autogrow-textarea');
      const inputs = Polymer.dom(element.root).querySelectorAll('input');
      return inputs.concat(textareas).concat(selects);
    }

    setup(() => {
      sandbox = sinon.sandbox.create();
      stub('gr-rest-api-interface', {
        getLoggedIn() { return Promise.resolve(false); },
        getProjectConfig() {
          return Promise.resolve({
            description: 'Access inherited by all other projects.',
            use_contributor_agreements: {
              value: false,
              configured_value: 'FALSE',
            },
            use_content_merge: {
              value: false,
              configured_value: 'FALSE',
            },
            use_signed_off_by: {
              value: false,
              configured_value: 'FALSE',
            },
            create_new_change_for_all_not_in_target: {
              value: false,
              configured_value: 'FALSE',
            },
            require_change_id: {
              value: false,
              configured_value: 'FALSE',
            },
            enable_signed_push: {
              value: false,
              configured_value: 'FALSE',
            },
            require_signed_push: {
              value: false,
              configured_value: 'FALSE',
            },
            reject_implicit_merges: {
              value: false,
              configured_value: 'FALSE',
            },
            private_by_default: {
              value: false,
              configured_value: 'FALSE',
            },
            match_author_to_committer_date: {
              value: false,
              configured_value: 'FALSE',
            },
            enable_reviewer_by_email: {
              value: false,
              configured_value: 'FALSE',
            },
            max_object_size_limit: {},
            submit_type: 'MERGE_IF_NECESSARY',
          });
        },
        getConfig() {
          return Promise.resolve({download: {}});
        },
      });
      element = fixture('basic');
    });

    teardown(() => {
      sandbox.restore();
    });

    test('loading displays before repo config is loaded', () => {
      assert.isTrue(element.$.loading.classList.contains('loading'));
      assert.isFalse(getComputedStyle(element.$.loading).display === 'none');
      assert.isTrue(element.$.loadedContent.classList.contains('loading'));
      assert.isTrue(getComputedStyle(element.$.loadedContent)
          .display === 'none');
    });

    test('download commands visibility', () => {
      element._loading = false;
      flushAsynchronousOperations();
      assert.isTrue(element.$.downloadContent.classList
          .contains('hideDownload'));
      assert.isTrue(getComputedStyle(element.$.downloadContent)
          .display == 'none');
      element._schemesObj = SCHEMES;
      flushAsynchronousOperations();
      assert.isFalse(element.$.downloadContent.classList
          .contains('hideDownload'));
      assert.isFalse(getComputedStyle(element.$.downloadContent)
          .display == 'none');
    });

    test('form defaults to read only', () => {
      assert.isTrue(element._readOnly);
    });

    test('form defaults to read only when not logged in', done => {
      element.repo = REPO;
      element._loadRepo().then(() => {
        assert.isTrue(element._readOnly);
        done();
      });
    });

    test('form defaults to read only when logged in and not admin', done => {
      element.repo = REPO;
      sandbox.stub(element, '_getLoggedIn', () => {
        return Promise.resolve(true);
      });
      sandbox.stub(element.$.restAPI, 'getRepoAccess', () => {
        return Promise.resolve({'test-repo': {}});
      });
      element._loadRepo().then(() => {
        assert.isTrue(element._readOnly);
        done();
      });
    });

    test('all form elements are disabled when not admin', done => {
      element.repo = REPO;
      element._loadRepo().then(() => {
        flushAsynchronousOperations();
        const formFields = getFormFields();
        for (const field of formFields) {
          assert.isTrue(field.hasAttribute('disabled'));
        }
        done();
      });
    });

    test('_formatBooleanSelect', () => {
      let item = {inherited_value: true};
      assert.deepEqual(element._formatBooleanSelect(item), [
        {
          label: 'Inherit (true)',
          value: 'INHERIT',
        },
        {
          label: 'True',
          value: 'TRUE',
        }, {
          label: 'False',
          value: 'FALSE',
        },
      ]);

      item = {inherited_value: false};
      assert.deepEqual(element._formatBooleanSelect(item), [
        {
          label: 'Inherit (false)',
          value: 'INHERIT',
        },
        {
          label: 'True',
          value: 'TRUE',
        }, {
          label: 'False',
          value: 'FALSE',
        },
      ]);

      // For items without inherited values
      item = {};
      assert.deepEqual(element._formatBooleanSelect(item), [
        {
          label: 'Inherit',
          value: 'INHERIT',
        },
        {
          label: 'True',
          value: 'TRUE',
        }, {
          label: 'False',
          value: 'FALSE',
        },
      ]);
    });

    suite('admin', () => {
      setup(() => {
        element.repo = REPO;
        sandbox.stub(element, '_getLoggedIn', () => {
          return Promise.resolve(true);
        });
        sandbox.stub(element.$.restAPI, 'getRepoAccess', () => {
          return Promise.resolve({'test-repo': {is_owner: true}});
        });
      });

      test('all form elements are enabled', done => {
        element._loadRepo().then(() => {
          flushAsynchronousOperations();
          const formFields = getFormFields();
          for (const field of formFields) {
            assert.isFalse(field.hasAttribute('disabled'));
          }
          assert.isFalse(element._loading);
          done();
        });
      });

      test('state gets set correctly', done => {
        element._loadRepo().then(() => {
          assert.equal(element._repoConfig.state, 'ACTIVE');
          assert.equal(element.$.stateSelect.bindValue, 'ACTIVE');
          done();
        });
      });

      test('fields update and save correctly', done => {
        // test notedb
        element._noteDbEnabled = false;

        assert.equal(
            element._computeRepositoriesClass(element._noteDbEnabled), '');

        element._noteDbEnabled = true;

        assert.equal(element._computeRepositoriesClass(
            element._noteDbEnabled), 'showConfig');

        const configInputObj = {
          description: 'new description',
          use_contributor_agreements: 'TRUE',
          use_content_merge: 'TRUE',
          use_signed_off_by: 'TRUE',
          create_new_change_for_all_not_in_target: 'TRUE',
          require_change_id: 'TRUE',
          enable_signed_push: 'TRUE',
          require_signed_push: 'TRUE',
          reject_implicit_merges: 'TRUE',
          private_by_default: 'TRUE',
          match_author_to_committer_date: 'TRUE',
          max_object_size_limit: 10,
          submit_type: 'FAST_FORWARD_ONLY',
          state: 'READ_ONLY',
          enable_reviewer_by_email: 'TRUE',
        };

        const saveStub = sandbox.stub(element.$.restAPI, 'saveRepoConfig'
            , () => {
              return Promise.resolve({});
            });

        const button = Polymer.dom(element.root).querySelector('gr-button');

        element._loadRepo().then(() => {
          assert.isTrue(button.hasAttribute('disabled'));
          assert.isFalse(element.$.Title.classList.contains('edited'));
          element.$.descriptionInput.bindValue = configInputObj.description;
          element.$.stateSelect.bindValue = configInputObj.state;
          element.$.submitTypeSelect.bindValue = configInputObj.submit_type;
          element.$.contentMergeSelect.bindValue =
              configInputObj.use_content_merge;
          element.$.newChangeSelect.bindValue =
              configInputObj.create_new_change_for_all_not_in_target;
          element.$.requireChangeIdSelect.bindValue =
              configInputObj.require_change_id;
          element.$.enableSignedPush.bindValue =
              configInputObj.enable_signed_push;
          element.$.requireSignedPush.bindValue =
              configInputObj.require_signed_push;
          element.$.rejectImplicitMergesSelect.bindValue =
              configInputObj.reject_implicit_merges;
          element.$.setAllnewChangesPrivateByDefaultSelect.bindValue =
              configInputObj.private_by_default;
          element.$.matchAuthoredDateWithCommitterDateSelect.bindValue =
              configInputObj.match_author_to_committer_date;
          element.$.maxGitObjSizeInput.bindValue =
              configInputObj.max_object_size_limit;
          element.$.contributorAgreementSelect.bindValue =
              configInputObj.use_contributor_agreements;
          element.$.useSignedOffBySelect.bindValue =
              configInputObj.use_signed_off_by;
          element.$.unRegisteredCcSelect.bindValue =
              configInputObj.enable_reviewer_by_email;

          assert.isFalse(button.hasAttribute('disabled'));
          assert.isTrue(element.$.configurations.classList.contains('edited'));

          const formattedObj =
              element._formatRepoConfigForSave(element._repoConfig);
          assert.deepEqual(formattedObj, configInputObj);

          element._handleSaveRepoConfig().then(() => {
            assert.isTrue(button.hasAttribute('disabled'));
            assert.isFalse(element.$.Title.classList.contains('edited'));
            assert.isTrue(saveStub.lastCall.calledWithExactly(REPO,
                configInputObj));
            done();
          });
        });
      });
    });
  });
</script>
