rusackas commented on a change in pull request #11271:
URL:
https://github.com/apache/incubator-superset/pull/11271#discussion_r504979296
##########
File path:
superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplatesList_spec.jsx
##########
@@ -74,4 +89,76 @@ describe('CssTemplatesList', () => {
it('renders a ListView', () => {
expect(wrapper.find(ListView)).toExist();
});
+
+ it('fetches templates', () => {
+ const callsQ = fetchMock.calls(/css_template\/\?q/);
+ expect(callsQ).toHaveLength(1);
+ expect(callsQ[0][0]).toMatchInlineSnapshot(
+
`"http://localhost/api/v1/css_template/?q=(order_column:template_name,order_direction:desc,page:0,page_size:25)"`,
+ );
+ });
+
+ it('renders Filters', () => {
+ expect(wrapper.find(Filters)).toExist();
+ });
+
+ it('searches', async () => {
+ const filtersWrapper = wrapper.find(Filters);
+ act(() => {
+ filtersWrapper
+ .find('[name="template_name"]')
+ .first()
+ .props()
+ .onSubmit('fooo');
+ });
+ await waitForComponentToPaint(wrapper);
+
+ expect(fetchMock.lastCall()[0]).toMatchInlineSnapshot(
+
`"http://localhost/api/v1/css_template/?q=(filters:!((col:template_name,opr:ct,value:fooo)),order_column:template_name,order_direction:desc,page:0,page_size:25)"`,
+ );
+ });
+
+ it('renders a DeleteModal', () => {
+ expect(wrapper.find(DeleteModal)).toExist();
+ });
+
+ it('deletes', async () => {
+ act(() => {
+
wrapper.find('span[data-test="delete-action"]').first().props().onClick();
Review comment:
Not sure we even need to rely on this being a span, but whatevs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]