Bring back all tests

Removed mock-diff-response as its not a test

Change-Id: I758659f9e4218b65e93325d6b7227f7fc0399571
(cherry picked from commit 4a0caab58e)
This commit is contained in:
Tao Zhou
2019-10-22 15:45:28 +02:00
committed by Paladox none
parent 5d29e77678
commit e7b549fcc7
7 changed files with 23 additions and 49 deletions

View File

@@ -70,10 +70,10 @@ limitations under the License.
test('getFilterValue', () => {
let params;
assert.equal(element.getFilterValue(params), null);
assert.equal(element.getFilterValue(params), '');
params = {filter: null};
assert.equal(element.getFilterValue(params), null);
assert.equal(element.getFilterValue(params), '');
params = {filter: 'test'};
assert.equal(element.getFilterValue(params), 'test');

View File

@@ -46,30 +46,13 @@ limitations under the License.
teardown(() => { sandbox.restore(); });
test('loads and clears account info', done => {
sandbox.stub(element.$.restAPI, 'getAccountDetails')
.returns(Promise.resolve({
name: 'foo',
email: 'bar',
registered_on: '2015-03-12 18:32:08.000000000',
}));
sandbox.stub(element.$.restAPI, 'getAccountStatus')
.returns(Promise.resolve('baz'));
element.userId = 'foo.bar@baz';
flush(() => {
assert.isOk(element._accountDetails);
assert.isOk(element._status);
element.userId = null;
flush(() => {
flushAsynchronousOperations();
assert.isNull(element._accountDetails);
assert.isNull(element._status);
done();
});
});
test('repoUrl reset once repo changed', () => {
sandbox.stub(Gerrit.Nav, 'getUrlForRepo',
repoName => `http://test.com/${repoName}`
);
assert.equal(element._repoUrl, undefined);
element.repo = 'test';
assert.equal(element._repoUrl, 'http://test.com/test');
});
});
</script>

View File

@@ -25,6 +25,7 @@ limitations under the License.
<script src="/bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="../../../test/common-test-setup.html"/>
<link rel="import" href="gr-dom-hooks.html"/>
<link rel="import" href="../../shared/gr-js-api-interface/gr-js-api-interface.html">
<script>void(0);</script>
@@ -118,7 +119,7 @@ limitations under the License.
hookInternal.handleInstanceAttached(el1);
hookInternal.handleInstanceAttached(el2);
assert.deepEqual([el1, el2], hook.getAllAttached());
hookI.handleInstanceDetached(el1);
hookInternal.handleInstanceDetached(el1);
assert.deepEqual([el2], hook.getAllAttached());
});

View File

@@ -47,7 +47,7 @@ limitations under the License.
}];
stub('gr-rest-api-interface', {
getAccountGroups() { return Promise.resolve(agreements); },
getAccountAgreements() { return Promise.resolve(agreements); },
});
element = fixture('basic');
@@ -58,10 +58,10 @@ limitations under the License.
test('renders', () => {
const rows = Polymer.dom(element.root).querySelectorAll('tbody tr');
assert.equal(rows.length, 3);
assert.equal(rows.length, 1);
const nameCells = rows.map(row =>
row.querySelectorAll('td')[0].textContent
const nameCells = Array.from(rows).map(row =>
row.querySelectorAll('td')[0].textContent.trim()
);
assert.equal(nameCells[0], 'Agreements 1');

View File

@@ -142,12 +142,12 @@ limitations under the License.
send: sendStub,
});
const errorStub = sandbox.stub();
document.addEventListener('network-error', errorStub);
document.addEventListener('show-alert', errorStub);
instance.call();
flush(() => {
assert.isTrue(errorStub.calledOnce);
assert.equal(errorStub.args[0][0].detail.message,
'Plugin network error: boom');
'Plugin network error: Error: boom');
done();
});
});

View File

@@ -100,7 +100,6 @@ limitations under the License.
assert.isTrue(button.disabled);
return deleteResponse.then(() => {
assert.isFalse(button.disabled);
assert.notOk(element.change.labels.test.recommended);
assert.isTrue(deleteStub.calledWithExactly(42, 1, 'test'));
});
});

View File

@@ -62,8 +62,7 @@ limitations under the License.
'change-list/gr-create-commands-dialog/gr-create-commands-dialog_test.html',
'change-list/gr-create-change-help/gr-create-change-help_test.html',
'change-list/gr-dashboard-view/gr-dashboard-view_test.html',
// TODO: uncomment file & fix tests. The file was missed in this list for a long time.
// 'change-list/gr-repo-header/gr-repo-header_test.html',
'change-list/gr-repo-header/gr-repo-header_test.html',
'change-list/gr-user-header/gr-user-header_test.html',
'change/gr-change-actions/gr-change-actions_test.html',
'change/gr-change-metadata/gr-change-metadata-it_test.html',
@@ -130,8 +129,7 @@ limitations under the License.
'plugins/gr-admin-api/gr-admin-api_test.html',
'plugins/gr-styles-api/gr-styles-api_test.html',
'plugins/gr-attribute-helper/gr-attribute-helper_test.html',
// TODO: uncomment file & fix tests. The file was missed in this list for a long time.
// 'plugins/gr-dom-hooks/gr-dom-hooks_test.html',
'plugins/gr-dom-hooks/gr-dom-hooks_test.html',
'plugins/gr-endpoint-decorator/gr-endpoint-decorator_test.html',
'plugins/gr-event-helper/gr-event-helper_test.html',
'plugins/gr-external-style/gr-external-style_test.html',
@@ -142,8 +140,7 @@ limitations under the License.
'plugins/gr-settings-api/gr-settings-api_test.html',
'plugins/gr-theme-api/gr-theme-api_test.html',
'settings/gr-account-info/gr-account-info_test.html',
// TODO: uncomment file & fix tests. The file was missed in this list for a long time.
// 'settings/gr-agreements-list/gr-agreements-list_test.html',
'settings/gr-agreements-list/gr-agreements-list_test.html',
'settings/gr-change-table-editor/gr-change-table-editor_test.html',
'settings/gr-cla-view/gr-cla-view_test.html',
'settings/gr-edit-preferences/gr-edit-preferences_test.html',
@@ -182,7 +179,6 @@ limitations under the License.
'shared/gr-editable-content/gr-editable-content_test.html',
'shared/gr-editable-label/gr-editable-label_test.html',
'shared/gr-formatted-text/gr-formatted-text_test.html',
// TODO: uncomment file & fix tests. The file was missed in this list for a long time.
'shared/gr-hovercard/gr-hovercard_test.html',
'shared/gr-js-api-interface/gr-annotation-actions-context_test.html',
'shared/gr-js-api-interface/gr-annotation-actions-js-api_test.html',
@@ -191,14 +187,12 @@ limitations under the License.
'shared/gr-js-api-interface/gr-api-utils_test.html',
'shared/gr-js-api-interface/gr-js-api-interface_test.html',
'shared/gr-js-api-interface/gr-gerrit_test.html',
// TODO: uncomment file & fix tests. The file was missed in this list for a long time.
// 'shared/gr-js-api-interface/gr-plugin-action-context_test.html',
'shared/gr-js-api-interface/gr-plugin-action-context_test.html',
'shared/gr-js-api-interface/gr-plugin-endpoints_test.html',
'shared/gr-js-api-interface/gr-plugin-rest-api_test.html',
'shared/gr-fixed-panel/gr-fixed-panel_test.html',
'shared/gr-labeled-autocomplete/gr-labeled-autocomplete_test.html',
// TODO: uncomment file & fix tests. The file was missed in this list for a long time.
// 'shared/gr-label-info/gr-label-info_test.html',
'shared/gr-label-info/gr-label-info_test.html',
'shared/gr-lib-loader/gr-lib-loader_test.html',
'shared/gr-limited-text/gr-limited-text_test.html',
'shared/gr-linked-chip/gr-linked-chip_test.html',
@@ -212,8 +206,6 @@ limitations under the License.
'shared/gr-rest-api-interface/gr-rest-api-interface_test.html',
'shared/gr-rest-api-interface/gr-reviewer-updates-parser_test.html',
'shared/gr-rest-api-interface/gr-rest-apis/gr-rest-api-helper_test.html',
// TODO: uncomment file & fix tests. The file was missed in this list for a long time.
// 'shared/gr-rest-api-interface/mock-diff-response_test.html',
'shared/gr-select/gr-select_test.html',
'shared/gr-shell-command/gr-shell-command_test.html',
'shared/gr-storage/gr-storage_test.html',
@@ -240,8 +232,7 @@ limitations under the License.
'gr-access-behavior/gr-access-behavior_test.html',
'gr-admin-nav-behavior/gr-admin-nav-behavior_test.html',
'gr-change-table-behavior/gr-change-table-behavior_test.html',
// TODO: uncomment file & fix tests. The file was missed in this list for a long time.
// 'gr-list-view-behavior/gr-list-view-behavior_test.html',
'gr-list-view-behavior/gr-list-view-behavior_test.html',
'gr-display-name-behavior/gr-display-name-behavior_test.html',
'gr-patch-set-behavior/gr-patch-set-behavior_test.html',
'gr-path-list-behavior/gr-path-list-behavior_test.html',