casper.click('.navigator-filter-more-criteria');
casper.waitUntilVisible('.navigator-filter-details.active', function checkTagsAreOrdered() {
- casper.click('.navigator-filter-details.active li:nth-last-child(2) label');
- test.assertSelectorHasText('.navigator-filter-details.active>.navigator-filter-select-list.choices>li:nth-child(1)', 'brain-overload');
- test.assertSelectorHasText('.navigator-filter-details.active>.navigator-filter-select-list.choices>li:nth-child(11)', 'unused');
+ casper.click('.navigator-filter-details.active label[data-property="tags"]');
+ test.assertSelectorHasText('.navigator-filter[data-property="tags"] option:nth-child(1)', 'brain-overload');
+ test.assertSelectorHasText('.navigator-filter[data-property="tags"] option:nth-child(11)', 'unused');
casper.click('.navigator-filter.active>.navigator-filter-disable');
});
});
test.done();
});
});
+
+
+casper.test.begin(testName('Tag Navigation Test'), function suite(test) {
+
+ casper.start(lib.buildUrl('coding-rules#tags=polop,bug,pilip,unused,palap'), function() {
+ lib.clearRequestMocks();
+ lib.mockRequest('/api/l10n/index', '{}');
+ lib.mockRequestFromFile('/api/rules/app', 'app_admin.json');
+ lib.mockRequestFromFile('/api/rules/tags', 'tags.json');
+ lib.mockRequestFromFile('/api/rules/search', 'search_x1.json');
+ lib.mockRequestFromFile('/api/rules/show', 'show_x1.json');
+ });
+
+
+ casper.waitWhileSelector("div#coding-rules-page-loader", function checkTagFilterRestored() {
+ casper.waitForSelector('.navigator-filters', function checkDefaultFilters() {
+ test.assertElementCount('.navigator-filter-disabled', 11 /* Tag is enabled */);
+ test.assertSelectorHasText('.navigator-filter[data-property="tags"] .navigator-filter-value', 'bug, unused');
+ });
+ });
+
+ casper.run(function() {
+ test.done();
+ });
+});