Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
seenanair committed Feb 7, 2024
1 parent b68c21d commit b509dff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/components/history/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export default function History(props: HistoryUrlParams) {
</Table>
</div>
</div>
{history.flggedBarcodes.length > 0 && (
{history.flaggedBarcodes.length > 0 && (
<div
className={
'mx-auto max-w-screen-lg flex flex-col mt-4 mb-4 w-full p-4 rounded-md justify-center bg-gray-200'
Expand All @@ -265,7 +265,7 @@ export default function History(props: HistoryUrlParams) {
<Table>
<TableBody>
<TableCell className={'flex flex-col justify-center p-2'}>
{history.flggedBarcodes.map((barcode, indx) => (
{history.flaggedBarcodes.map((barcode, indx) => (
<StyledLink
data-testid={`styled-link-${barcode}`}
key={barcode}
Expand Down
2 changes: 1 addition & 1 deletion src/components/history/history.machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function createHistoryMachine() {
initial: 'searching',
context: {
historyProps: {},
history: { entries: [], flggedBarcodes: [] },
history: { entries: [], flaggedBarcodes: [] },
serverError: null
},
states: {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/historyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ export async function findHistory(historyProps: HistoryUrlParams): Promise<Histo
});
return {
entries,
flggedBarcodes: history.flaggedBarcodes
flaggedBarcodes: history.flaggedBarcodes
};
}
2 changes: 1 addition & 1 deletion src/types/stan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export type HistoryTableEntry = {

export type HistoryData = {
entries: Array<HistoryTableEntry>;
flggedBarcodes: Array<string>;
flaggedBarcodes: Array<string>;
}

/**
Expand Down
15 changes: 7 additions & 8 deletions tests/unit/components/history/history.machine.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('historyMachine', () => {
const mockSearchMachine = createHistoryMachine()
.withContext({
historyProps: { workNumber: 'SGP8' },
history: [],
history: { entries: [], flaggedBarcodes: [] },
serverError: null
})
.withConfig({
Expand All @@ -113,7 +113,7 @@ describe('historyMachine', () => {
if (state.matches('found')) {
expect(state.context).toEqual({
historyProps: { workNumber: 'SGP8' },
history: mockHistorySearchResults,
history: { entries: mockHistorySearchResults, flaggedBarcodes: [] },
serverError: null
});
done();
Expand All @@ -129,7 +129,7 @@ describe('historyMachine', () => {
const mockSearchMachine = createHistoryMachine()
.withContext({
historyProps: { workNumber: 'SGP8' },
history: [],
history: { entries: [], flaggedBarcodes: [] },
serverError: null
})
.withConfig({
Expand All @@ -142,8 +142,7 @@ describe('historyMachine', () => {
if (state.matches('found')) {
expect(state.context).toEqual({
historyProps: { workNumber: 'SGP8' },
history: mockHistorySearchResults,
serverError: null
history: { entries: mockHistorySearchResults, flaggedBarcodes: [], serverError: null }
});
expect(searchCount).toEqual(2);
done();
Expand All @@ -159,7 +158,7 @@ describe('historyMachine', () => {
const mockHistoryMachine = createHistoryMachine()
.withContext({
historyProps: { workNumber: 'SGP8' },
history: [],
history: { entries: [], flaggedBarcodes: [] },
serverError: null
})
.withConfig({
Expand Down Expand Up @@ -189,7 +188,7 @@ describe('historyMachine', () => {
const mockSearchMachine = createHistoryMachine()
.withContext({
historyProps: { workNumber: 'SGP8' },
history: [],
history: { entries: [], flaggedBarcodes: [] },
serverError: null
})
.withConfig({
Expand Down Expand Up @@ -223,7 +222,7 @@ describe('historyMachine', () => {
const mockSearchMachine = createHistoryMachine()
.withContext({
historyProps: { workNumber: 'SGP8' },
history: [],
history: { entries: [], flaggedBarcodes: [] },
serverError: null
})
.withConfig({
Expand Down

0 comments on commit b509dff

Please sign in to comment.