import { filesSelector } from "../selectors";

describe("Test Files Selectors", () => {
    const state = {
        files: { documents: [{ id: "foo" }, { id: "fud" }] }
    };

    let result;
    let expected;

    it("filesSelector: returns data used to render a list of files", () => {
        result = filesSelector(state);
        expected = ["foo", "fud"];
        expect(result).toEqual(expected);
    });
});

@@ -89,13 +89,68 @@
     
-const
+let state;%0A    let expected;%0A%0A    beforeEach(() =%3E %7B%0A       
  sta
@@ -168,16 +168,20 @@
     
+    
 files: %7B
  doc
@@ -176,16 +176,32 @@
 files: %7B
+%0A               
  documen
@@ -220,221 +220,618 @@
 foo%22
- %7D, %7B id: %22fud%22 %7D%5D
+, ready: true, reserved: false %7D, %7B id: %22fud%22, ready: true, reserved: false %7D%5D%0A           
  %7D%0A    
+ 
-%7D;%0A%0A    let result;%0A    let expected;%0A%0A    it(%22filesSelector: returns data used to render a list of files%22, () =%3E %7B%0A        result = filesSelector(state);%0A        expected = %5B%22foo%22, %22fud%22%5D
+   %7D;%0A    %7D);%0A%0A    it(%22returns all document ids when appropriate%22, () =%3E %7B%0A        const result = filesSelector(state);%0A        expect(result).toEqual(%5B%22foo%22, %22fud%22%5D);%0A    %7D);%0A%0A    it(%22excludes ids unready documents%22, () =%3E %7B%0A        state.files.documents%5B0%5D.ready = false;%0A        const result = filesSelector(state);%0A        expect(result).toEqual(%5B%22fud%22%5D);%0A    %7D);%0A%0A    it(%22excludes ids reserved documents%22, () =%3E %7B%0A        state.files.documents%5B1%5D.reserved = true;%0A        const result = filesSelector(state)
 ;%0A  
@@ -859,24 +859,23 @@
 toEqual(
-expected
+%5B%22foo%22%5D
 );%0A    %7D

Update file selector tests