Commit db5b585a authored by Winnie Hellmann's avatar Winnie Hellmann

Remove remaining references to filtered_search_token_keys_issues.js

parent 47485f58
import FilteredSearchTokenKeysIssues from 'ee/filtered_search/filtered_search_token_keys_issues'; import IssuesFilteredSearchTokenKeysEE from 'ee/filtered_search/issues_filtered_search_token_keys';
import FilteredSearchContainer from '../filtered_search/container'; import FilteredSearchContainer from '../filtered_search/container';
import FilteredSearchManager from '../filtered_search/filtered_search_manager'; import FilteredSearchManager from '../filtered_search/filtered_search_manager';
...@@ -9,7 +9,7 @@ export default class FilteredSearchBoards extends FilteredSearchManager { ...@@ -9,7 +9,7 @@ export default class FilteredSearchBoards extends FilteredSearchManager {
isGroupDecendent: true, isGroupDecendent: true,
stateFiltersSelector: '.issues-state-filters', stateFiltersSelector: '.issues-state-filters',
isGroup: true, isGroup: true,
filteredSearchTokenKeys: FilteredSearchTokenKeysIssues, filteredSearchTokenKeys: IssuesFilteredSearchTokenKeysEE,
}); });
this.store = store; this.store = store;
......
import FilteredSearchTokenKeysIssues from 'ee/filtered_search/filtered_search_token_keys_issues'; import IssuesFilteredSearchTokenKeysEE from 'ee/filtered_search/issues_filtered_search_token_keys';
describe('Filtered Search Token Keys (Issues EE)', () => { describe('Filtered Search Token Keys (Issues EE)', () => {
const weightTokenKey = { const weightTokenKey = {
...@@ -14,10 +14,10 @@ describe('Filtered Search Token Keys (Issues EE)', () => { ...@@ -14,10 +14,10 @@ describe('Filtered Search Token Keys (Issues EE)', () => {
let tokenKeys; let tokenKeys;
beforeEach(() => { beforeEach(() => {
FilteredSearchTokenKeysIssues.init({ IssuesFilteredSearchTokenKeysEE.init({
multipleAssignees: true, multipleAssignees: true,
}); });
tokenKeys = FilteredSearchTokenKeysIssues.get(); tokenKeys = IssuesFilteredSearchTokenKeysEE.get();
}); });
it('should return tokenKeys', () => { it('should return tokenKeys', () => {
...@@ -34,7 +34,7 @@ describe('Filtered Search Token Keys (Issues EE)', () => { ...@@ -34,7 +34,7 @@ describe('Filtered Search Token Keys (Issues EE)', () => {
}); });
it('should always return the same array', () => { it('should always return the same array', () => {
const tokenKeys2 = FilteredSearchTokenKeysIssues.get(); const tokenKeys2 = IssuesFilteredSearchTokenKeysEE.get();
expect(tokenKeys).toEqual(tokenKeys2); expect(tokenKeys).toEqual(tokenKeys2);
}); });
...@@ -47,8 +47,8 @@ describe('Filtered Search Token Keys (Issues EE)', () => { ...@@ -47,8 +47,8 @@ describe('Filtered Search Token Keys (Issues EE)', () => {
describe('getKeys', () => { describe('getKeys', () => {
it('should return keys', () => { it('should return keys', () => {
const getKeys = FilteredSearchTokenKeysIssues.getKeys(); const getKeys = IssuesFilteredSearchTokenKeysEE.getKeys();
const keys = FilteredSearchTokenKeysIssues.get().map(i => i.key); const keys = IssuesFilteredSearchTokenKeysEE.get().map(i => i.key);
keys.forEach((key, i) => { keys.forEach((key, i) => {
expect(key).toEqual(getKeys[i]); expect(key).toEqual(getKeys[i]);
...@@ -60,7 +60,7 @@ describe('Filtered Search Token Keys (Issues EE)', () => { ...@@ -60,7 +60,7 @@ describe('Filtered Search Token Keys (Issues EE)', () => {
let conditions; let conditions;
beforeEach(() => { beforeEach(() => {
conditions = FilteredSearchTokenKeysIssues.getConditions(); conditions = IssuesFilteredSearchTokenKeysEE.getConditions();
}); });
it('should return conditions', () => { it('should return conditions', () => {
...@@ -79,89 +79,89 @@ describe('Filtered Search Token Keys (Issues EE)', () => { ...@@ -79,89 +79,89 @@ describe('Filtered Search Token Keys (Issues EE)', () => {
describe('searchByKey', () => { describe('searchByKey', () => {
it('should return null when key not found', () => { it('should return null when key not found', () => {
const tokenKey = FilteredSearchTokenKeysIssues.searchByKey('notakey'); const tokenKey = IssuesFilteredSearchTokenKeysEE.searchByKey('notakey');
expect(tokenKey === null).toBe(true); expect(tokenKey === null).toBe(true);
}); });
it('should return tokenKey when found by key', () => { it('should return tokenKey when found by key', () => {
const tokenKeys = FilteredSearchTokenKeysIssues.get(); const tokenKeys = IssuesFilteredSearchTokenKeysEE.get();
const result = FilteredSearchTokenKeysIssues.searchByKey(tokenKeys[0].key); const result = IssuesFilteredSearchTokenKeysEE.searchByKey(tokenKeys[0].key);
expect(result).toEqual(tokenKeys[0]); expect(result).toEqual(tokenKeys[0]);
}); });
it('should return weight tokenKey when found by weight key', () => { it('should return weight tokenKey when found by weight key', () => {
const tokenKeys = FilteredSearchTokenKeysIssues.get(); const tokenKeys = IssuesFilteredSearchTokenKeysEE.get();
const match = tokenKeys.find(tk => tk.key === weightTokenKey.key); const match = tokenKeys.find(tk => tk.key === weightTokenKey.key);
const result = FilteredSearchTokenKeysIssues.searchByKey(weightTokenKey.key); const result = IssuesFilteredSearchTokenKeysEE.searchByKey(weightTokenKey.key);
expect(result).toEqual(match); expect(result).toEqual(match);
}); });
}); });
describe('searchBySymbol', () => { describe('searchBySymbol', () => {
it('should return null when symbol not found', () => { it('should return null when symbol not found', () => {
const tokenKey = FilteredSearchTokenKeysIssues.searchBySymbol('notasymbol'); const tokenKey = IssuesFilteredSearchTokenKeysEE.searchBySymbol('notasymbol');
expect(tokenKey === null).toBe(true); expect(tokenKey === null).toBe(true);
}); });
it('should return tokenKey when found by symbol', () => { it('should return tokenKey when found by symbol', () => {
const tokenKeys = FilteredSearchTokenKeysIssues.get(); const tokenKeys = IssuesFilteredSearchTokenKeysEE.get();
const result = FilteredSearchTokenKeysIssues.searchBySymbol(tokenKeys[0].symbol); const result = IssuesFilteredSearchTokenKeysEE.searchBySymbol(tokenKeys[0].symbol);
expect(result).toEqual(tokenKeys[0]); expect(result).toEqual(tokenKeys[0]);
}); });
it('should return weight tokenKey when found by weight symbol', () => { it('should return weight tokenKey when found by weight symbol', () => {
const tokenKeys = FilteredSearchTokenKeysIssues.get(); const tokenKeys = IssuesFilteredSearchTokenKeysEE.get();
const match = tokenKeys.find(tk => tk.key === weightTokenKey.key); const match = tokenKeys.find(tk => tk.key === weightTokenKey.key);
const result = FilteredSearchTokenKeysIssues.searchBySymbol(weightTokenKey.symbol); const result = IssuesFilteredSearchTokenKeysEE.searchBySymbol(weightTokenKey.symbol);
expect(result).toEqual(match); expect(result).toEqual(match);
}); });
}); });
describe('searchByKeyParam', () => { describe('searchByKeyParam', () => {
it('should return null when key param not found', () => { it('should return null when key param not found', () => {
const tokenKey = FilteredSearchTokenKeysIssues.searchByKeyParam('notakeyparam'); const tokenKey = IssuesFilteredSearchTokenKeysEE.searchByKeyParam('notakeyparam');
expect(tokenKey === null).toBe(true); expect(tokenKey === null).toBe(true);
}); });
it('should return tokenKey when found by key param', () => { it('should return tokenKey when found by key param', () => {
const tokenKeys = FilteredSearchTokenKeysIssues.get(); const tokenKeys = IssuesFilteredSearchTokenKeysEE.get();
const result = FilteredSearchTokenKeysIssues const result = IssuesFilteredSearchTokenKeysEE
.searchByKeyParam(`${tokenKeys[0].key}_${tokenKeys[0].param}`); .searchByKeyParam(`${tokenKeys[0].key}_${tokenKeys[0].param}`);
expect(result).toEqual(tokenKeys[0]); expect(result).toEqual(tokenKeys[0]);
}); });
it('should return alternative tokenKey when found by key param', () => { it('should return alternative tokenKey when found by key param', () => {
const tokenKeys = FilteredSearchTokenKeysIssues.getAlternatives(); const tokenKeys = IssuesFilteredSearchTokenKeysEE.getAlternatives();
const result = FilteredSearchTokenKeysIssues const result = IssuesFilteredSearchTokenKeysEE
.searchByKeyParam(`${tokenKeys[0].key}_${tokenKeys[0].param}`); .searchByKeyParam(`${tokenKeys[0].key}_${tokenKeys[0].param}`);
expect(result).toEqual(tokenKeys[0]); expect(result).toEqual(tokenKeys[0]);
}); });
it('should return weight tokenKey when found by weight key param', () => { it('should return weight tokenKey when found by weight key param', () => {
const tokenKeys = FilteredSearchTokenKeysIssues.get(); const tokenKeys = IssuesFilteredSearchTokenKeysEE.get();
const match = tokenKeys.find(tk => tk.key === weightTokenKey.key); const match = tokenKeys.find(tk => tk.key === weightTokenKey.key);
const result = FilteredSearchTokenKeysIssues.searchByKeyParam(weightTokenKey.key); const result = IssuesFilteredSearchTokenKeysEE.searchByKeyParam(weightTokenKey.key);
expect(result).toEqual(match); expect(result).toEqual(match);
}); });
}); });
describe('searchByConditionUrl', () => { describe('searchByConditionUrl', () => {
it('should return null when condition url not found', () => { it('should return null when condition url not found', () => {
const condition = FilteredSearchTokenKeysIssues.searchByConditionUrl(null); const condition = IssuesFilteredSearchTokenKeysEE.searchByConditionUrl(null);
expect(condition === null).toBe(true); expect(condition === null).toBe(true);
}); });
it('should return condition when found by url', () => { it('should return condition when found by url', () => {
const conditions = FilteredSearchTokenKeysIssues.getConditions(); const conditions = IssuesFilteredSearchTokenKeysEE.getConditions();
const result = FilteredSearchTokenKeysIssues const result = IssuesFilteredSearchTokenKeysEE
.searchByConditionUrl(conditions[0].url); .searchByConditionUrl(conditions[0].url);
expect(result).toBe(conditions[0]); expect(result).toBe(conditions[0]);
}); });
it('should return weight condition when found by weight url', () => { it('should return weight condition when found by weight url', () => {
const conditions = FilteredSearchTokenKeysIssues.getConditions(); const conditions = IssuesFilteredSearchTokenKeysEE.getConditions();
const weightConditions = conditions.filter(c => c.tokenKey === 'weight'); const weightConditions = conditions.filter(c => c.tokenKey === 'weight');
const result = FilteredSearchTokenKeysIssues const result = IssuesFilteredSearchTokenKeysEE
.searchByConditionUrl(weightConditions[0].url); .searchByConditionUrl(weightConditions[0].url);
expect(result).toBe(weightConditions[0]); expect(result).toBe(weightConditions[0]);
}); });
...@@ -169,22 +169,22 @@ describe('Filtered Search Token Keys (Issues EE)', () => { ...@@ -169,22 +169,22 @@ describe('Filtered Search Token Keys (Issues EE)', () => {
describe('searchByConditionKeyValue', () => { describe('searchByConditionKeyValue', () => {
it('should return null when condition tokenKey and value not found', () => { it('should return null when condition tokenKey and value not found', () => {
const condition = FilteredSearchTokenKeysIssues const condition = IssuesFilteredSearchTokenKeysEE
.searchByConditionKeyValue(null, null); .searchByConditionKeyValue(null, null);
expect(condition === null).toBe(true); expect(condition === null).toBe(true);
}); });
it('should return condition when found by tokenKey and value', () => { it('should return condition when found by tokenKey and value', () => {
const conditions = FilteredSearchTokenKeysIssues.getConditions(); const conditions = IssuesFilteredSearchTokenKeysEE.getConditions();
const result = FilteredSearchTokenKeysIssues const result = IssuesFilteredSearchTokenKeysEE
.searchByConditionKeyValue(conditions[0].tokenKey, conditions[0].value); .searchByConditionKeyValue(conditions[0].tokenKey, conditions[0].value);
expect(result).toEqual(conditions[0]); expect(result).toEqual(conditions[0]);
}); });
it('should return weight condition when found by weight tokenKey and value', () => { it('should return weight condition when found by weight tokenKey and value', () => {
const conditions = FilteredSearchTokenKeysIssues.getConditions(); const conditions = IssuesFilteredSearchTokenKeysEE.getConditions();
const weightConditions = conditions.filter(c => c.tokenKey === 'weight'); const weightConditions = conditions.filter(c => c.tokenKey === 'weight');
const result = FilteredSearchTokenKeysIssues const result = IssuesFilteredSearchTokenKeysEE
.searchByConditionKeyValue(weightConditions[0].tokenKey, weightConditions[0].value); .searchByConditionKeyValue(weightConditions[0].tokenKey, weightConditions[0].value);
expect(result).toEqual(weightConditions[0]); expect(result).toEqual(weightConditions[0]);
}); });
......
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