mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 22:05:07 -02:30
remove outdated tests
This commit is contained in:
@@ -24,28 +24,6 @@ describe('PersistentFilters', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should restore filters from sessionStorage', () => {
|
|
||||||
expect(
|
|
||||||
sessionStorage.setItem(
|
|
||||||
KEY,
|
|
||||||
JSON.stringify({
|
|
||||||
pageKey: 'templates',
|
|
||||||
qs: '?page=2&name=foo',
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
const history = createMemoryHistory({
|
|
||||||
initialEntries: ['/templates?restoreFilters=true'],
|
|
||||||
});
|
|
||||||
render(
|
|
||||||
<Router history={history}>
|
|
||||||
<PersistentFilters pageKey="templates">test</PersistentFilters>
|
|
||||||
</Router>
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(history.location.search).toEqual('?page=2&name=foo');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('should not restore filters without restoreFilters query param', () => {
|
test('should not restore filters without restoreFilters query param', () => {
|
||||||
expect(
|
expect(
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem(
|
||||||
@@ -68,28 +46,6 @@ describe('PersistentFilters', () => {
|
|||||||
expect(history.location.search).toEqual('');
|
expect(history.location.search).toEqual('');
|
||||||
});
|
});
|
||||||
|
|
||||||
test("should not restore filters if page key doesn't match", () => {
|
|
||||||
expect(
|
|
||||||
sessionStorage.setItem(
|
|
||||||
KEY,
|
|
||||||
JSON.stringify({
|
|
||||||
pageKey: 'projects',
|
|
||||||
qs: '?page=2&name=foo',
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
const history = createMemoryHistory({
|
|
||||||
initialEntries: ['/templates?restoreFilters=true'],
|
|
||||||
});
|
|
||||||
render(
|
|
||||||
<Router history={history}>
|
|
||||||
<PersistentFilters pageKey="templates">test</PersistentFilters>
|
|
||||||
</Router>
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(history.location.search).toEqual('');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('should update stored filters when qs changes', async () => {
|
test('should update stored filters when qs changes', async () => {
|
||||||
const history = createMemoryHistory({
|
const history = createMemoryHistory({
|
||||||
initialEntries: ['/templates'],
|
initialEntries: ['/templates'],
|
||||||
|
|||||||
Reference in New Issue
Block a user