Skip to content

Commit

Permalink
fix: Remove the unused lufiles in notifications (#1760)
Browse files Browse the repository at this point in the history
* Remove the unused lufiles in notifications

* fix e2e test
  • Loading branch information
lei9444 authored and a-b-r-o-w-n committed Dec 11, 2019
1 parent f8bfd6d commit 2abb4cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Composer/cypress/integration/NotificationPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context('Notification Page', () => {
beforeEach(() => {
cy.visit(Cypress.env('COMPOSER_URL'));
cy.createBot('TodoSample');
cy.createBot('ToDoBotWithLuisSample');
cy.visitPage('Notifications');
});

Expand All @@ -31,7 +31,7 @@ context('Notification Page', () => {
it('can show lu syntax error ', () => {
cy.visitPage('User Input');

cy.get('.dialogNavTree button[title="__TestTodoSample.Main"]').click({ multiple: true });
cy.get('.dialogNavTree button[title="__TestToDoBotWithLuisSample.Main"]').click({ multiple: true });

cy.get('.toggleEditMode button').click();
cy.get('textarea').type('test lu syntax error');
Expand All @@ -45,18 +45,18 @@ context('Notification Page', () => {
.click();
});

cy.findAllByText('__TestTodoSample.Main').should('exist');
cy.findAllByText('__TestToDoBotWithLuisSample.Main').should('exist');
});

it('can show dialog expression error ', () => {
cy.visitPage('Design Flow');

cy.findByTestId('ProjectTree').within(() => {
cy.findByText('Greeting').click();
cy.findByText('WelcomeUser').click();
});

cy.withinEditor('VisualEditor', () => {
cy.findByText('Greeting').should('exist');
cy.findByText('WelcomeUser').should('exist');
});

cy.withinEditor('FormEditor', () => {
Expand All @@ -73,6 +73,6 @@ context('Notification Page', () => {
.click();
});

cy.findAllByText('Greeting').should('exist');
cy.findAllByText('WelcomeUser').should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { StoreContext } from '../../store';
import { replaceDialogDiagnosticLabel } from '../../utils';

import { INotification, DiagnosticSeverity } from './types';
import { getReferredFiles } from './../../utils/luUtil';

export default function useNotifications(filter?: string) {
const { state } = useContext(StoreContext);
Expand All @@ -28,7 +29,7 @@ export default function useNotifications(filter?: string) {
});
});
});
luFiles.forEach(lufile => {
getReferredFiles(luFiles, dialogs).forEach(lufile => {
lufile.diagnostics.map(diagnostic => {
const location = `${lufile.id}.lu`;
notifactions.push({
Expand Down

0 comments on commit 2abb4cb

Please sign in to comment.