Lines Matching refs:state
9 .onTransition((state) => {
10 if (state.value === 'checking') {
11 expect(state.context.isChecking).toBe(true);
24 .onTransition((state) => {
25 if (state.value === 'checking') {
27 } else if (state.value === 'idle' && wasChecking) {
28 expect(state.context.isChecking).toBe(false);
29 expect(state.context.checkError).toBeUndefined();
30 expect(state.context.latestManifest).toEqual({ updateId: testUpdateId });
31 expect(state.context.isUpdateAvailable).toBe(true);
32 expect(state.context.isUpdatePending).toBe(false);
51 .onTransition((state) => {
52 if (state.value === 'downloading') {
53 expect(state.context.isDownloading).toBe(true);
69 .onTransition((state) => {
70 if (state.value === 'downloading') {
72 } else if (state.value === 'idle' && wasDownloading) {
73 expect(state.context.isChecking).toBe(false);
74 expect(state.context.checkError).toBeUndefined();
75 expect(state.context.latestManifest).toEqual({ updateId: testUpdateId });
76 expect(state.context.downloadedManifest).toEqual({ updateId: testUpdateId });
77 expect(state.context.isUpdateAvailable).toBe(true);
78 expect(state.context.isUpdatePending).toBe(true);
98 .onTransition((state) => {
99 if (state.value === 'checking') {
101 } else if (state.value === 'idle' && wasChecking) {
102 expect(state.context.isChecking).toBe(false);
103 expect(state.context.checkError).toBeUndefined();
104 expect(state.context.latestManifest).toBeUndefined();
105 expect(state.context.isUpdateAvailable).toBe(true);
106 expect(state.context.isRollback).toBe(true);
107 expect(state.context.isUpdatePending).toBe(false);
129 .onTransition((state) => {
130 if (state.value === 'checking') {
133 if (state.value === 'downloading') {
135 } else if (state.value === 'idle' && wasChecking && wasDownloading) {
136 expect(state.context.isChecking).toBe(false);
137 expect(state.context.checkError).toBeUndefined();
138 expect(state.context.latestManifest).toBeUndefined();
139 expect(state.context.downloadedManifest).toEqual({ updateId: testUpdateId });
140 expect(state.context.isUpdateAvailable).toBe(false);
141 expect(state.context.isUpdatePending).toBe(true);