|
@@ -231,8 +231,7 @@ describe('IssueList', function () {
|
|
|
|
|
|
expect(screen.getByRole('textbox')).toHaveValue('is:unresolved ');
|
|
expect(screen.getByRole('textbox')).toHaveValue('is:unresolved ');
|
|
|
|
|
|
- // Tab shows "saved searches" because there is an is:unresolved tab
|
|
|
|
- expect(screen.getByRole('button', {name: 'Saved Searches'})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: /custom search/i})).toBeInTheDocument();
|
|
});
|
|
});
|
|
|
|
|
|
it('loads with query in URL and pinned queries', async function () {
|
|
it('loads with query in URL and pinned queries', async function () {
|
|
@@ -270,7 +269,7 @@ describe('IssueList', function () {
|
|
expect(screen.getByRole('textbox')).toHaveValue('level:foo ');
|
|
expect(screen.getByRole('textbox')).toHaveValue('level:foo ');
|
|
|
|
|
|
// Tab shows "custom search"
|
|
// Tab shows "custom search"
|
|
- expect(screen.getByRole('tab', {name: 'Custom Search'})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: 'Custom Search'})).toBeInTheDocument();
|
|
});
|
|
});
|
|
|
|
|
|
it('loads with a pinned custom query', async function () {
|
|
it('loads with a pinned custom query', async function () {
|
|
@@ -305,7 +304,7 @@ describe('IssueList', function () {
|
|
expect(screen.getByRole('textbox')).toHaveValue('is:resolved ');
|
|
expect(screen.getByRole('textbox')).toHaveValue('is:resolved ');
|
|
|
|
|
|
// Organization saved search selector should have default saved search selected
|
|
// Organization saved search selector should have default saved search selected
|
|
- expect(screen.getByRole('tab', {name: 'My Default Search'})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: 'My Default Search'})).toBeInTheDocument();
|
|
});
|
|
});
|
|
|
|
|
|
it('loads with a saved query', async function () {
|
|
it('loads with a saved query', async function () {
|
|
@@ -350,7 +349,7 @@ describe('IssueList', function () {
|
|
expect(screen.getByRole('textbox')).toHaveValue('assigned:me ');
|
|
expect(screen.getByRole('textbox')).toHaveValue('assigned:me ');
|
|
|
|
|
|
// Organization saved search selector should have default saved search selected
|
|
// Organization saved search selector should have default saved search selected
|
|
- expect(screen.getByRole('tab', {name: 'Assigned to Me'})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: 'Assigned to Me'})).toBeInTheDocument();
|
|
});
|
|
});
|
|
|
|
|
|
it('loads with a query in URL', async function () {
|
|
it('loads with a query in URL', async function () {
|
|
@@ -392,7 +391,7 @@ describe('IssueList', function () {
|
|
expect(screen.getByRole('textbox')).toHaveValue('level:error ');
|
|
expect(screen.getByRole('textbox')).toHaveValue('level:error ');
|
|
|
|
|
|
// Organization saved search selector should have default saved search selected
|
|
// Organization saved search selector should have default saved search selected
|
|
- expect(screen.getByRole('tab', {name: 'Custom Search'})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: 'Custom Search'})).toBeInTheDocument();
|
|
});
|
|
});
|
|
|
|
|
|
it('loads with an empty query in URL', async function () {
|
|
it('loads with an empty query in URL', async function () {
|
|
@@ -430,10 +429,10 @@ describe('IssueList', function () {
|
|
expect(screen.getByRole('textbox')).toHaveValue('is:resolved ');
|
|
expect(screen.getByRole('textbox')).toHaveValue('is:resolved ');
|
|
|
|
|
|
// Organization saved search selector should have default saved search selected
|
|
// Organization saved search selector should have default saved search selected
|
|
- expect(screen.getByRole('tab', {name: 'My Default Search'})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: 'My Default Search'})).toBeInTheDocument();
|
|
});
|
|
});
|
|
|
|
|
|
- it('selects a saved search', async function () {
|
|
|
|
|
|
+ it('1 search', async function () {
|
|
const localSavedSearch = {...savedSearch, projectId: null};
|
|
const localSavedSearch = {...savedSearch, projectId: null};
|
|
savedSearchesRequest = MockApiClient.addMockResponse({
|
|
savedSearchesRequest = MockApiClient.addMockResponse({
|
|
url: '/organizations/org-slug/searches/',
|
|
url: '/organizations/org-slug/searches/',
|
|
@@ -446,7 +445,7 @@ describe('IssueList', function () {
|
|
|
|
|
|
await waitForElementToBeRemoved(() => screen.getByTestId('loading-indicator'));
|
|
await waitForElementToBeRemoved(() => screen.getByTestId('loading-indicator'));
|
|
|
|
|
|
- userEvent.click(screen.getByRole('button', {name: /saved searches/i}));
|
|
|
|
|
|
+ userEvent.click(screen.getByRole('button', {name: /custom search/i}));
|
|
userEvent.click(screen.getByRole('button', {name: localSavedSearch.name}));
|
|
userEvent.click(screen.getByRole('button', {name: localSavedSearch.name}));
|
|
|
|
|
|
expect(browserHistory.push).toHaveBeenLastCalledWith(
|
|
expect(browserHistory.push).toHaveBeenLastCalledWith(
|
|
@@ -538,7 +537,7 @@ describe('IssueList', function () {
|
|
{context: routerContext, router: routerWithQuery}
|
|
{context: routerContext, router: routerWithQuery}
|
|
);
|
|
);
|
|
|
|
|
|
- expect(screen.getByRole('tab', {name: 'Custom Search'})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: 'Custom Search'})).toBeInTheDocument();
|
|
|
|
|
|
MockApiClient.clearMockResponses();
|
|
MockApiClient.clearMockResponses();
|
|
const createPin = MockApiClient.addMockResponse({
|
|
const createPin = MockApiClient.addMockResponse({
|
|
@@ -598,7 +597,7 @@ describe('IssueList', function () {
|
|
|
|
|
|
await waitForElementToBeRemoved(() => screen.getByTestId('loading-indicator'));
|
|
await waitForElementToBeRemoved(() => screen.getByTestId('loading-indicator'));
|
|
|
|
|
|
- expect(screen.getByRole('tab', {name: 'My Default Search'})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: 'My Default Search'})).toBeInTheDocument();
|
|
|
|
|
|
userEvent.click(screen.getByLabelText(/Remove Default/i));
|
|
userEvent.click(screen.getByLabelText(/Remove Default/i));
|
|
|
|
|
|
@@ -652,7 +651,7 @@ describe('IssueList', function () {
|
|
|
|
|
|
await waitForElementToBeRemoved(() => screen.getByTestId('loading-indicator'));
|
|
await waitForElementToBeRemoved(() => screen.getByTestId('loading-indicator'));
|
|
|
|
|
|
- expect(screen.getByRole('tab', {name: savedSearch.name})).toBeInTheDocument();
|
|
|
|
|
|
+ expect(screen.getByRole('button', {name: savedSearch.name})).toBeInTheDocument();
|
|
|
|
|
|
userEvent.click(screen.getByLabelText(/set as default/i));
|
|
userEvent.click(screen.getByLabelText(/set as default/i));
|
|
|
|
|