Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadkitenge committed Aug 9, 2023
1 parent aa06ee0 commit 8c73cee
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/table/sessions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ describe('Sessions', () => {
cy.findByRole('button', { name: 'Save as' }).click();
cy.findByLabelText('Save Session').should('exist');

cy.findByLabelText('Name*').should(($input) => {
cy.findByLabelText('Name *').should(($input) => {
const value = $input.val();
expect(value).to.equal('Session 2_copy');
});
Expand Down
8 changes: 4 additions & 4 deletions src/mocks/sessionsList.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Session 1",
"summary": "This is the summary for Session 1",
"auto_saved": true,
"timestamp": "2023-06-29T10:30:00Z",
"timestamp": "2023-06-29T10:30:00",
"session": {
"table": {
"columnStates": {},
Expand Down Expand Up @@ -87,7 +87,7 @@
"name": "Session 2",
"summary": "This is the summary for Session 2",
"auto_saved": false,
"timestamp": "2023-06-29T14:45:00Z",
"timestamp": "2023-06-29T14:45:00",
"session": {
"table": {
"columnStates": {},
Expand Down Expand Up @@ -136,7 +136,7 @@
"name": "Session 3",
"summary": "This is the summary for Session 3",
"auto_saved": true,
"timestamp": "2023-06-30T09:15:00Z",
"timestamp": "2023-06-30T09:15:00",
"session": {
"table": {
"columnStates": {},
Expand Down Expand Up @@ -167,7 +167,7 @@
"summary": "This is the summary for Session 4",
"auto_saved": false,
"name": "Session 4",
"timestamp": "2023-06-30T09:15:00Z",
"timestamp": "2023-06-30T09:15:00",
"session": {
"table": {
"columnStates": {},
Expand Down
3 changes: 2 additions & 1 deletion src/session/sessionSaveButtons.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ describe('session buttons', () => {
name: 'test',
summary: 'test',
auto_saved: false,
session_data: '{}',
session: {},
_id: '1',
timestamp: '',
};
createView();
const saveButton = screen.getByRole('button', { name: 'Save' });
Expand Down
2 changes: 0 additions & 2 deletions src/session/sessionSaveButtons.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ const SessionSaveButtons = (props: SessionsSaveButtonsProps) => {
timestamp = undefined;

const formatDate = (inputDate: string) => {
console.log(inputDate);
const date = parseISO(inputDate);
console.log(date);
const formattedDate = format(date, 'dd MMM yyyy HH:mm');
return formattedDate;
};
Expand Down
2 changes: 1 addition & 1 deletion src/views/viewTabs.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('View Tabs', () => {
const dialog = screen.getByRole('dialog');

const summaryTextarea = within(dialog).getByLabelText('Summary');
const nameInput = within(dialog).getByLabelText('Name*');
const nameInput = within(dialog).getByLabelText('Name *');

expect(summaryTextarea).toHaveTextContent(
'This is the summary for Session 1'
Expand Down

0 comments on commit 8c73cee

Please sign in to comment.