UX: Remove category hashtag decoration.

This commit is contained in:
Guo Xiang Tan
2016-01-21 12:27:16 +08:00
parent 4a17cdc1e4
commit bd86e88b05
9 changed files with 20 additions and 90 deletions

View File

@@ -1,22 +0,0 @@
import createStore from 'helpers/create-store';
import Category from 'discourse/models/category';
import { findCategoryByHashtagSlug } from "discourse/lib/category-hashtags";
module("lib:category-hashtags");
test('findCategoryByHashtagSlug', () => {
const store = createStore();
const parentCategory = store.createRecord('category', { slug: 'test1' });
const childCategory = store.createRecord('category', {
slug: 'test2', parentCategory: parentCategory
});
sandbox.stub(Category, 'list').returns([parentCategory, childCategory]);
equal(findCategoryByHashtagSlug('test1'), parentCategory, 'returns the right category');
equal(findCategoryByHashtagSlug('test1:test2'), childCategory, 'returns the right category');
equal(findCategoryByHashtagSlug('#test1'), parentCategory, 'returns the right category');
equal(findCategoryByHashtagSlug('#test1:test2'), childCategory, 'returns the right category');
});

View File

@@ -29,10 +29,7 @@ module("lib:click-track", {
</div>
<a id="same-site" href="http://discuss.domain.com">forum</a>
<a class="attachment" href="http://discuss.domain.com/uploads/default/1234/1532357280.txt">log.txt</a>
<a class="badge-wrapper bullet" href="http://discuss.domain.com">
<span class="badge-category-bg"></span>
<span class="badge-category"></span>
</a>
<a class="hashtag" href="http://discuss.domain.com">#hashtag</a>
</article>
</div>`);
}
@@ -69,7 +66,7 @@ test("does not track clicks on quote buttons", function() {
});
test("does not track clicks on category badges", () => {
ok(!track(generateClickEventOn('.badge-wrapper')));
ok(!track(generateClickEventOn('.hashtag')));
});
test("removes the href and put it as a data attribute", function() {